More you share, more you have!!!

More you share, more you have!!!

How to perform addition of two numbers without using addition(plus) operator in C language?

Addition without  plus operator

Q.How to perform addition of two numbers without using addition(plus) operator in C language?

Answer: 

Let us write C program,

#include<stdio.h>
#include<conio.h>
int x=1;
int y=8;
void main()
{
clrscr();
printf("x=1 and y=8 \n");
printf("Addition of two numbers(x,y) is %d \t",(x-(-y)));
getch();
}


Output :

x=1 and y=8
Addition of two numbers(x,y) is 9

Share on Google Plus
    Blogger Comment
    Facebook Comment

1 comments: