/* Write a C program to add two values without using '+' operator */
#include<stdio.h>
int main() {
int num1 = 10, num2 = 5;
num1 = num1 - (-num2);
printf("Sum is : %d",num1);
return (0);
}
Output
---------
Sum is : 15
#include<stdio.h>
int main() {
int num1 = 10, num2 = 5;
num1 = num1 - (-num2);
printf("Sum is : %d",num1);
return (0);
}
Output
---------
Sum is : 15
No comments:
Post a Comment