TOPUPchat logo...
Forgot password?

Select : C language | Java

Q.5] specifying bits in structure for variables in c

struct marks{
 int p:3;
 int c:3;
 int m:2;
};
void main(){
 struct marks s={2,-6,5};
 printf("%d %d %d",s.p,s.c,s.m);
}
    

Options]

(a) 2 -6 5
(b) 2 -6 1
(c) 2 2 1
(d) Compiler error
(e) None of these        

Click to See Answer
(c) 2 2 1    

Next | using or calling printf inside of printf as argument

Previous | operation of switch case without break keyword

Hemen Ashodia [paper setter]
Register & recharge
Male Female
I agree Terms and Conditions