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
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
How do I use strcmp?
How can I list all of the predefined identifiers?
Differentiate abs() function from fabs() function.
Why enum is used in c?
What is difference between class and structure?
What is the use of typedef in structure in c?
What is the use of c language in real life?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
Explain what is the advantage of a random access file?
Calculate 1*2*3*____*n using recursive function??
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
How are 16- and 32-bit numbers stored?
How many types of operators are there in c?