C Program to Add two numbers without using any operator.

Write a C program to find sum of positive integers without using any operator. Only use of printf() is allowed. No other library function can be used.

Example program: 

#include<stdio.h>
int add(int x, int y)
{
    return printf("%*c%*c",  x, ' ',  y, ' ');
}

int main()
{
    printf("Sum = %d", add(3, 4));
    return 0;
}

Output:


Powered by Blogger.