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 is string concatenation in c?
What is meant by inheritance?
Explain the use of 'auto' keyword in c programming?
What is union in c?
I have seen function declarations that look like this
What does double pointer mean in c?
What is character constants?
What is the difference between call by value and call by reference in c?
can any one provide me the notes of data structure for ignou cs-62 paper
Why c is called free form language?
What is c programing language?
Explain the difference between strcpy() and memcpy() function?
Write a program to generate random numbers in c?
What are categories used for in c?
Explain what are run-time errors?