+ 1
How to add two numbers using user input
2 Respostas
+ 2
First, Define the values.Example:
int A, B;
Second, use cin and >> for request the user the values and put the variables in the cin for asign the values at the variables.
Example:
cin >> A >> B;
Good Luck!
+ 1
int first , second ;
printf("Enter first number :" ) ;
scanf("%d",&first) ;
printf("Enter Second number :" ) ;
scanf("%d",&second) ;
printf("\n\t %d ", first+second) ;