Mega Code Archive

 
Categories / C Tutorial / Operator
 

Using the Addition operator

#include <stdio.h> main(){   int iOperand1 = 0;   int iOperand2 = 0;   int iResult = 0;   printf("\nEnter first operand: ");   scanf("%d", &iOperand1);   printf("Enter second operand: ");   scanf("%d", &iOperand2);   iResult = iOperand1 + iOperand2;   printf("The result is %d\n", iResult); } Enter first operand: 1 Enter second operand: 2 The result is 3