#include <stdio.h>
int main()
{
int firstNumber;
int secondNumber;
int sum;
printf("Enter a whole number (i.e. 5, 14, 32):\n");
scanf("%d", &firstNumber);
printf("Enter another one:\n");
scanf("%d", &secondNumber);
sum = firstNumber + secondNumber;
printf("The sum of %d and %d is %d.\n", firstNumber, secondNumber, sum);
return 0;
}
gcc ~/Desktop/add.c -o add
~/Desktop/add
barhar said:Apple's 'TextEdit' will save the 'add.c' file as 'add.c.rtf' (rich text format) by default. Even renaming the file as 'add.c', in 'Finder', will not help since 'gcc' will not properly compile it.