1. Write a c program without using any semicolon which output will : Hello world.
Ans.
Solution: 1
Ans.
Solution: 1
void main(){
if(printf("Hello world")){
}
}
Solution: 2
void main(){
while(!printf("Hello world")){
}
}
Solution: 3
void main(){
switch(printf("Hello world")){
}
}
2.What is dangling pointer in c?
Ans.
If any pointer is pointing the memory address of any variable but after some variable has deleted from that memory location while pointer is still pointing such memory location. Such pointer is known as dangling pointer and this problem is known as dangling pointer problem.
3.What is wild pointer in c ?
Ans.
A pointer in c which has not been initialized is known as wild pointer.
4.memory representation of
int a = 7; ?Ans.
Memory representation of:
signed int a=7; (In Turbo c compiler)
signed short int a=7 (Both turbo c and Linux gcc compiler)
Binary equivalent of data 7 in 16 bit: 00000000 00000111
Data bit: 0000000 00000111 (Take first 15 bit form right side)
Sign bit: 0 (Take leftmost one bit)
First eight bit of data bit from right side i.e. 00000111 will store in the leftmost byte from right to left side and rest seven bit of data bit i.e. 0000000 will store in rightmost byte from right to left side..
5.What is the far pointer in c?
Ans.The pointer which can point or access whole the residence memory of RAM i.e. which can access all 16 segments is known as far pointer.
No comments:
Post a Comment