Saturday, 29 June 2013

CLASS 2 FOR C PROGRAMMING

Now we can learn how to use operators in c program.
+,-,*,/ are operators.So we can add,subtract,multiply and two or more numbers.

The logic for the program:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a=10,b=5,c;
clrscr();
c=a+b;
printf("sum;%d",c);
getch();
}
You will get output as 15.
You can choose any value of a and b.
int a=10,b=5.c; is called declaration.
You can use same logic for rest operators.



1 comment: