C
Programming and Technical
Programming
Program
write a c program for addition of two numbers, without using "+" operator?
Read Solution (Total 15)
-
- #include
int main(void) {
int a,b,sum;
scanf("%d%d",&a,&b);
sum=a-(-b);
printf("%d",sum);
return 0;
} - 10 years agoHelpfull: Yes(17) No(0)
- #include
int main()
{
int a=5,b=6;
while(b--){
a++;
}
printf("%d",a);
return 0;
}
- 10 years agoHelpfull: Yes(5) No(0)
- RAM your expression is wrong,
(a+b)^2 = a^2 - 2ab + b^2 + 4ab
= (a-b)^2 + 4ab
so the expression should have been
sum=sqrt[(a-b)^2-(-4*a*b)];
- 10 years agoHelpfull: Yes(3) No(1)
- #include
int main(void) {
int a,b,sum;
scanf("%d%d",&a,&b);
sum=a-(-b);
printf("%d",sum);
return 0;
} - 10 years agoHelpfull: Yes(3) No(0)
- #inlcude
#include
void main()
{
int a,b,sum;
printf("enter the value of a");
scanf("%d",&a);
printf("enter the value of b");
scanf("%d",&b);
sum=a-~b-1;
printf("sum is %d" sum);
} - 10 years agoHelpfull: Yes(2) No(0)
- AN EASY APPROACH
#include
#define plus +
int main()
{
int a=1, b=2;
int c= a plus b;
printf("%d",c);
} - 10 years agoHelpfull: Yes(2) No(3)
- #include
int main(void) {
int a,b,sum;
scanf("%d%d",&a,&b);
sum=a-(-b);
printf("%d",sum);
return 0;
} - 10 years agoHelpfull: Yes(0) No(0)
- #include
int main(void) {
int a,b,sum;
scanf("%d%d",&a,&b);
sum=sqrt[(a-b)^2-4*a*b];
printf("%d",sum);
return 0;
} - 10 years agoHelpfull: Yes(0) No(0)
- void main{
int a,b;
scanf("%d,%d",a,b);
for(int i=1;i - 10 years agoHelpfull: Yes(0) No(1)
- #include
main()
{
int a,b,c,d,e;
printf("enter two numbers");
scanf("%d%d",a,b);
c=a*b;
d=a-b;
e=c+d;
printf("%d",e);
} - 10 years agoHelpfull: Yes(0) No(1)
- int main()
{
int a,b,c,count,i;
a=5;
b=6;
count=b;
for(i=0;i - 10 years agoHelpfull: Yes(0) No(0)
#include
int main(){
int a,b;
int sum;
printf("Enter any two integers: ");
scanf("%d%d",&a,&b);
//sum = a - (-b);
sum = a - ~b -1;
printf("Sum of two integers: %d",sum);
return 0;
}- 10 years agoHelpfull: Yes(0) No(0)
- #include
main()
{
- 10 years agoHelpfull: Yes(0) No(0)
- #include
main()
{
int a=10,b=30;
printf("
%d
",printf("%*c%*c",a,0,b,0));
} - 10 years agoHelpfull: Yes(0) No(0)
- #include
void main()
{
int a,b,c;
scanf("%d%d",&a,&b);
c=a-(-b);
printf("%d",c);
getch();
} - 9 years agoHelpfull: Yes(0) No(0)
C Other Question