C Programming
Simple Operations in Cvoid main()
{
int a,b;
clrscr();
printf("Enter Two No.");
scanf("%d%d",&a,&b);
printf("\nsum=%d", a+b);
printf("\nSubs=%d",a-b);
printf("\nMulti=%d", a*b);
printf("\nDivision=%d",a/b);
getch();
}
Note:
- a, b is integer variable which will store integer value range -32768- +32767
- clrscr() is the function which wiil clear the screen and set the cursor at first position on the screen.
- printf() is the function that display :- Enter Two No.
- scanf() store the value that we give on console in the respective variable i.e.- a,b
- printf("\nsum=%d", a+b) -> "\n" change the line and set cursor at new line. "sum=" is the message and a+b add the value of a and b and also print it.
- getch() waits untill we press.