How to learn the C language in easy way

WAP TO PRINT SUM OPERATION

#include<stdio.h>
void main()
{
int a,b,SUM;  // Variable declaration

clrscr();         //To clear screen
printf("enter the value of a=");   //To display
scanf("%d",&a);                       //Read value from keyboard
printf("enter the value of b=");
scanf("%d",&b);
SUM=a+b;                    // Logic
printf("SUM=%d",SUM);  // To Display result
getch();   //To hold the output on the screen
}
o/P:- enter the value of a= 4
      enter the value of b= 6
       
      SUM is = 10

No comments:

Post a Comment