Write a program to find the sum of two numbers without using any operator.
Example:
Input: num1 =5 num2= 10
Output: Sum is 15
Approach
C
#include <stdio.h>int addNumbers(int x, int y){return printf("%*c%*c", x, ' ', y, ' ');}int main(){int num1 = 5, num2 = 10;int sum = addNumbers(num1, num2);printf("Sum is %d ", sum);return 0;}
No comments:
Post a Comment