What is the output of following program ?
int
main()
{
int x = 5;
printf("%d %d %d\n", x, x << 2, x >> 2);
}
Answer Posted / krishna deep sharma
4,4,1
coz we shift the bit as 5=101 now shift two bit to right as
101>>2=001
now
2<<001=100
noe x=4
printf execute from right to left so ans is 4,4,1
| Is This Answer Correct ? | 11 Yes | 28 No |
Post New Answer View All Answers
How can I read and write comma-delimited text?
What is sizeof array in c?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
What is the use of #define preprocessor in c?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
Explain the advantages and disadvantages of macros.
what is different between auto and local static? why should we use local static?
Where are some collections of useful code fragments and examples?
Not all reserved words are written in lowercase. TRUE or FALSE?
Explain what is the heap?
What is scope and lifetime of a variable in c?
Sir i need notes for structure,functions,pointers in c language can you help me please
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
What is the purpose of the statement: strcat (S2, S1)?