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 |
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
writte a c-programm to display smill paces
Write a program to print a square of size 5 by using the character S.
Printf can be implemented by using __________ list.
write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30
How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com
int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too
main() { char a[4]="HELLO"; printf("%s",a); }
find A^B using Recursive function
String reverse with time complexity of n/2 with out using temporary variable.
hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?
Write a routine to implement the polymarker function