Q. 1 . Find the correct output
void main() {
int a=30,b=20,c;
c=(float)a/b;
printf("%d",c);
}
a . 1
b . 1.500000
c . 1.000000
d . Error
Q. 2 . State the correct statement.
struct employee
{
int eid;
char name[23];
float salary;
}emp={278,"p.das",5000.000},*p=&emp;
How to access eid in the above structure?
I. *p->eid
II. p.eid
III. (*p).eid
IV. (*p)->eid
a . Only I
b . Only III
c . Both I & III
d . All of the above
Q. 3 . Find out the output
void main()
{
int ch=48;
if(ch)
{
printf("valid");
break;
}
else
printf("invalid");
}
a . valid
b . invalid
c . No output
d . None of these
Q. 4 . Find out the output
void main()
{
int k=1;
printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE");
}
a . Error
b . 1==1 is TRUE
c . 0==1 is FALSE
d . Garbage Output
Q. 5 . what is the o/p in turbo compiler?
struct stud
{
int x:18;
char *y;
f loat z;
}s1;
void main()
{
printf("%d",sizeof(s1));
}
a . 7
b . 1
c . 8
d . Error
Q. 6 . Find the output
void main()
{
int i=-3,j=2,k=0,m;
m=++ && j++ && ++k;
printf("\n%d, %d, %d, %d",i,j,k,m);
}
a . -2,-3,1,1
b . -3, 2, 0,1
c . -2, 3, 0,1
d . -2, 3, 1,0
Q. 7 . Find the output.
void main()
{
int x=5,y=6;
do{
x=x+y;
y=x-y;
x=x-y;
}while(x0)
rev(--n);
printf("%d",n);
}
a . 0012
b . 123
c . 012
d . None of these
Q. 9 . RAM is made up of
a . registers
b . diodes
c . capacitors
d . flip-flops
Q. 10 . The default memory model in C is
a . tiny
b . small
c . medium
d . compact
Q. 11 . Find the correct output
void main()
{
int i=5;
i=i++ + ++i;
printf("%d",i);
}
a . 11
b . 12
c . 13
d . None of these
Q. 12 . Find out the output
int i = 4;
void main()
{
switch (i)
{
default:
;
case 3:
i += 5;
if ( i == 8);
{
i++;
if (i = 9);
i *= 2;
}
i -= 4;
break;
case 8:
i += 5;
break;
}
printf("i = %d\n", i);
}
a . i=5
b . i=16
c . i=18
d . i=14
Q. 13 . Find out the output.
void main()
{
printf("%d",sizeof(5.3));
}
a . 2
b . 4
c . 8
d . Suffering
Q. 14 . A file pointer is
a . a stream pointer
b . a buffer pointer
c . a pointer to a FILE data type
d . All of the above
Q. 15 . Find out the output
void main()
{
char p[6];
static char *q;
q=p;
*q="Hello";
printf("%s",q);
}
a . Garbage output
b . Hello
c . Error
d . None of these
Q. 16 . Find out the output
void main()
{
int x[]={1,2,3,4,5,6};
int *p,q,r;
p=x+3;
q=5;r=4;
printf("%d",p[(q>r)-2]);
}
a . 4
b . 3
c . 5
d . Error
Q. 17 . What is the formula to find real address from 16-bit physical address?
a . segment address*16+offset address
b . segment address+offset address *16
c . segment address*10+offset address
d . segment address+offset address *10
Q. 18 . The function strcmp(s1,s2) returns negative value if
a . Length of s1 is less than s2
b . Length of s2 is less than s1
c . Length of s1 is less than or equal to s2
d . Both s1 and s2 are same.
Q. 19 . Find the output.
void main()
{
int a,b,sum=0;
sum= (a=5,b=9,++a+ ++b);
printf("%d", sum);
}
a . 16
b . 5
c . Expression syntax error
d . Error, lvalue required
Q. 20 . Find out the output
#define Str(x) #x
#define Xstr(x) Str(x)
#define OP plus
void main()
{
int *opname = Xstr(OP);
printf("%s",opname);
}
a . plus
b . No output
c . It will show compilation error
d . No output
Q. 21 . void main() { int i,j=1; for(i=1;i<5;i++) i="=" j="=" i="1;" i="=" x="5;" temp="a;" a="b;" b="temp;" a="5,b="> b)
swap(a,b);
printf("a=%d b=%d",a,b);
}
a . a=5 b=6
b . a=6 b=5
c . a=6 b=0
d . None of these
Q. 26 . Find out the output
main()
{
static int val=7;
int data;
if (--val)
{
data=main()+val;
printf("%d ",data);
}
return 0;
}
a . Compile time Error
b . Infinite loop
c . 1 2 3 4 5 6
d . 0 0 0 0 0 0
Q. 27 . Find out the output.
void main()
{
int i=5,j=5;
i= i++*i++*i++*i++;
printf("i=%d ",i);
j= ++j*++j*++j*++j;
printf("j=%d",j);
}
a . i=1680 j=1680
b . i=629 j=6561
c . i=1681 j=3024
d . Compile time Error
Q. 28 . State the true statement.
a . A circular list doesn’t have a natural first or last node.
b . It is always desirable keep an extra node at the front of the list.
c . A stack can’t be represented in memory using linear array.
d . All of the above
Q. 29 . Find the output
#define float int
void main()
{
int x=10;
float y=3;
y=x%y;
printf("%f",y);
}
a . 0
b . 1
c . 1.000000
d . Error, floating point format not linked
Q. 30 . Find the output
void main()
{
int *q,**p,x=4;
q=&x;
p=&q;
(**p)++;
++*p;
printf("%d",**p);
}
a . 5
b . 6
c . Garbage output
d . Error, non portable pointer conversion
No comments:
Post a Comment