#include<iostream.h>
#include<conio.h>
struct marks
{
int a:3;
int b:3;
int c:2;
};
int main()
{
clrscr();
marks m={2,12,5};
cout<<m.a<<m.b<<m.c;
getch();
return(0);
}
o/p is 2-41
i got how 2 and 1 came but didnt get how -4 came.
according to me it should have been
binary for 12=1100
b can store 3 bits so it should have been 4.