How to add two numbers without using arithmetic operators?
Answers were Sorted based on User's Feedback
Answer / ramanareddy
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("enter the two numbers");
scanf("%d %d",%a,&b);
c=(-(-a-b));
printf("sum is = %d",c");
getch();
}
Is This Answer Correct ? | 0 Yes | 4 No |
Answer / abhishek shukla
what will be output of this programme?
#include<stdio.h>
#include<conio.h>
void main()
{
int a=5;
clrscr();
a=a+(2,3,3,5,8,6);
printf("%d",a);
getch();
}
Is This Answer Correct ? | 1 Yes | 6 No |
Answer / pugalarasu
int sum(int num1,int num2)
{
for(int i=0;i<num2;i++)
num1++;
return num1;
}
Is This Answer Correct ? | 39 Yes | 50 No |
Answer / ranjith
#include<stdio.h>
main()
{
int a=5,b=4,c;
c=a||b;
printf("sum="+c);
}
Is This Answer Correct ? | 2 Yes | 21 No |
Answer / suhas
# include <stdio.h>
main()
{
int a=8,b=2;
a|=b;
printf("sum="+a);
}
Is This Answer Correct ? | 7 Yes | 43 No |
Answer / kavi
#include<stdio.h>
int a,b,c;
{
printf("enter the two values");
scanf("%d","%d",&a,&b);
c=a||b;
}
Is This Answer Correct ? | 10 Yes | 80 No |
Answer / prashant
even this gives the same ans as the above program gives...
just every one plz check it and tell me
#include<stdio.h>
#include<math.h>
int main()
{
int a,b,c;
printf("enter the nos");
scanf("%d %d",&b,&c);
a= (b^c);
printf("%d",a);
return 0;
}
Is This Answer Correct ? | 19 Yes | 114 No |
What should malloc() do?
what is the output of following question? void main() { int i=0,a[3]; a[i]=i++; printf("%d",a[i] }
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include<stdio.h>’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro?
void main() { int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} }; int (*p)[2]; int i,j,*pint; for(i=0;i<=3;i++) { p=&s[i]; pint=p; printf("\n"); for(j=0;j<=1;j++) printf("%d",*(pint+j)); } } while running this program it shows a warning-suspicious pointer conversion ie pint=p; my que is why should we assign the value of p to pint again.why cant we use it directly as *(p+j)..but if i use like tat the o/p is garbage value..
write a program to print calender using for loop.
Is void a keyword in c?
What is the size of empty structure in c?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
How does struct work in c?
write a c program to find the square of a 5 digit number and print the result.
5 Answers Accenture, Sasken, Vimukti Technologies,
How do you generate random numbers in C?