main()
{
int i;
clrscr();
for(i=0;i<5;i++)
{
printf("%d\n", 1L << i);
}
}
a. 5, 4, 3, 2, 1
b. 0, 1, 2, 3, 4
c. 0, 1, 2, 4, 8
d. 1, 2, 4, 8, 16
Answers were Sorted based on User's Feedback
Answer / thilaga
Clearly ans is d.
1<<0 times is 0001.so in decimal 1.
1<<1 times is 0010.so in decimal 2.
1<<2 times is 0100.so in decimal 4.
1<<3 times is 1000.so in decimal 8.
1<<4 times is 0001 0000.so in decimal 16.
thus it becomes 1,2,4,8,16.
Is This Answer Correct ? | 24 Yes | 2 No |
Answer / aditi
none of them is correct...
coz l does'nt make any diff...
and << means a left shift
o in binary is 0 only...
and wen it is lft shfted it remains same...
1 in binary is 01 >> makes it 010 i.e 2
nd so on...
Is This Answer Correct ? | 1 Yes | 15 No |
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
plz send me all data structure related programs
C program to print magic square of order n where n > 3 and n is odd
#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }
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"); }
Sorting entire link list using selection sort and insertion sort and calculating their time complexity
1 Answers Infosys, Microsoft, NetApp,
void main() { int i=5; printf("%d",i+++++i); }
What is full form of PEPSI
write a program for area of circumference of shapes
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }
What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }
Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])