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
What are static variables in c?
What extern c means?
What is merge sort in c?
Define VARIABLE?
What is new line escape sequence?
How do you use a pointer to a function?
By using C language input a date into it and if it is right?
What is self-referential structure in c programming?
How do I determine whether a character is numeric, alphabetic, and so on?
How do you write a program which produces its own source code as output?
What are type modifiers in c?
What is difference between class and structure?
What is the right type to use for boolean values in c? Is there a standard type?
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
Explain b+ tree?