Hi,
I am really new to programming and trying to teach myself c and it's not easy! Could someone please tell me why this won't work. it's not finished yet still need to add the sqrt statement. I get stuck at the average calculations.
thanks in advance...
jasemca
Code:
#include <stdio.h>
#include <math.h>
int main()
{
// Create two new integers to gather values
int a = 0;
int b = 0;
int a+b =c;
// Get me a number from the user (a)
printf("Enter a positive whole number.\n");
scanf("%d", &a);
printf ("You entered %d.\n", a);
// Get another number (b)
printf("Enter a positive whole number.\n");
scanf("%d", &b);
printf ("You entered %d.\n", b);
// Print the average
scanf("%f",c = (a+b)/2);
printf ("Average is: %f.\n", c);
// Print another math function
return 0;
}