2008-07-09, 04:59 PM
All programs have the following:
To declare the identifiers you do the following:
If you want to make a simple math equation, like adding two numbers, here's an example:
Quote:#include <stdio.h>
#include <stdlib.h>
int main()
{
system("pause");
return 0;
}
To declare the identifiers you do the following:
Quote:data_type variable_name;
Example:
int a;
float b;
char c;
If you want to make a simple math equation, like adding two numbers, here's an example:
Quote:#include <stdio.h>
#include <stdlib.h>
int main()
{
int a, b, c; //declaring the variables
printf("Insert the first number: "); //asking the user to input the number
scanf("%d", &a); //saving that number on the variable "a"
printf("Insert the second number: "); //see above
scanf("%d", &b); //see above
c=a+b; //self-explanatory.
printf("The result is: %d ", c); //the user will get the answer.
system("pause");
return 0;
}

