using math .h
#include "stdio.h"
#include "math.h"
void main ( )
{
int a,b,c;
a= 10;
b=20;
c=a+b;
printf("sum=%d\n",c);
getchar( );
getchar( );
}
output
sum=30
output
sum=30
note :
- you can change the operator symbol like + : add , - :subtract , / : divide , * : multiplication ; ^:exportation.
- if you want to write the numbers in decimals write for int write float in printf for %d write %f