without using arithmatic operator convert an intger variable
x into x+1
Answer Posted / vadivel t
#include<stdio.h>
void main()
{
int no;
int size, i;
printf("ENTER THE NO: ");
scanf("%d",&no);
size = sizeof(int) * 8;
for(i = 0; i < size; i++)
{
if((no & (0x01 << i)) != 0)
{
no = no^(0x01 << i);
}
else
{
no = no |(0x01 << i);
break;
}
}
printf("OUTPUT :%d \n", no);
_getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
When was c language developed?
Why should I prototype a function?
Explain what are the standard predefined macros?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
Where are the auto variables stored?
main() { printf("hello"); fork(); }
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
What is meant by type specifiers?
What is the use of the function in c?
What is the use of bitwise operator?
Function calling procedures? and their differences? Why should one go for Call by Reference?
What is atoi and atof in c?
what is the diffrenet bettwen HTTP and internet protocol
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3