main()
{
signed int bit=512, mBit;
{
mBit = ~bit;
bit = bit & ~bit ;
printf("%d %d", bit, mBit);
}
}
a. 0, 0
b. 0, 513
c. 512, 0
d. 0, -513
Answers were Sorted based on User's Feedback
Give a one-line C expression to test whether a number is a power of 2.
Write a C function to search a number in the given list of numbers. donot use printf and scanf
main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)
void main() { int c; c=printf("Hello world"); printf("\n%d",c); }
#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }
Write a program that reads a dynamic array of 40 integers and displays only even integers
What is the main difference between STRUCTURE and UNION?
main() { int i = 3; for (;i++=0;) printf(“%d”,i); }
what is the code of the output of print the 10 fibonacci number series
main() { int c=- -2; printf("c=%d",c); }
Code for 1>"ascii to string" 2>"string to ascii"
1 Answers Aricent, Global Logic,