IN ORDER TO TAKE INPUT FROM THE USER WE USE SCANF FUNCTION .
SYNTAX FOR USING SCANF = > scanf ( " %d " , & i ) ;
& IS THE ADDRESS OF THE OPERATOR
#include <stdio.h>
int main()
{
int a,b,Sum;
printf("Enter the value of a\n");
scanf("%d",&a);
printf("Enter the value of b\n");
scanf("%d",&b);
Sum=a+b;
printf("the sum of a and b is %d",Sum);
return 0;
}
No comments:
Post a Comment