+ 1

How to add two numbers using user input

24th Apr 2017, 8:26 PM
Evans Godsaint Junior
Evans Godsaint Junior - avatar
2 Antworten
+ 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!
24th Apr 2017, 8:30 PM
Alberto Del Angel
Alberto Del Angel - avatar
+ 1
int first , second ; printf("Enter first number :" ) ; scanf("%d",&first) ; printf("Enter Second number :" ) ; scanf("%d",&second) ; printf("\n\t %d ", first+second) ;
25th Apr 2017, 2:42 AM
‎علي فرعون‎
‎علي فرعون‎ - avatar