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 is 1f in c?
What are header files and what are its uses in C programming?
What is int main () in c?
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
Why is sizeof () an operator and not a function?
int j =15,i; for (i=1; 1<5; ++i) {printf ("%d%d ",j,i); j = j-3; }
How many types of operator or there in c?
Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning
the output will be #include<stdio.h> int main () { int i; i = 9/2; printf("%i",i); return 0; }
Do you know the difference between malloc() and calloc() function?
1,1,5,17,61,217,?,?.