User input and addition of two numbers
int It is used for defining the variables in integer value.
scanf("**",**) It is a function in <stdio.h> which helps us to takes the user input into the program.
&(am percent) It is defined as the address of declared variables. Ex- (&a) (&b)
\n It means new line character, It breaks the statement from a new line.
move on to code:👇
#include <stdio.h>
int main()
{
int a, b;
printf("Enter number a\n");
scanf("%d", &a);
printf("Enter number b\n");
scanf("%d", &b);
printf("Your added number is here: %d \n", a+b);
return 0;
}
Comments
Post a Comment