GRAND TEST : RVS
1.#include<stdio.h>
int main(){
int no[2][2]={{0},{1,2}};
clrscr();
printf(‘%d’,no[0][0]);
}
a)0 b)nothing c)error d)1
2.#include<stdio.h>
int main()
{
int no[][3]={{0},{1,{2},3}};
clrscr();
printf("%d",no[0][0]);
}
a)error b)nothing c)0 d)3
3.#include<stdio.h>
int main()
{
int i=10;
int no[2][4]={1,0,2};
clrscr();
printf("%d",sizeof(no));
}
a)6 b)8 c)2 d)16
4.#include<stdio.h>
int main()
{
int i=-1;
int no[3][3]={{1,2,3},{4,5,6},{7,8,9}};
clrscr();
for(i++;i<=2;i++)
printf("%d,",0[no[i]]);
}a)1,2,3 b)1,5,9 c)1,4,7 d)
5.#include<stdio.h>
int main()
{
int i=-1;
int no[3][3]={{1,2,3},{4,5,6},{7,8,9}};
clrscr();
for(i++;i<=2;i++)
printf("%d,",1[0[no]]);
}
a)2,2,2 b)4,5,6 c)5,5,5 d)4,4,4
6.
main(){
char*str=”I love java”;
str=str+3;
printf(“%s”,str);
}
a.i love java b)error c)ove java d)ve java
7.
main(){
char*s[3]={”I love java”,”C++”,”MySQL”};
char**str;
str[0]=s[0];
printf(“%s”,s[0]);
}
a)error b)i love java c)I d)null
8.void main()
{
char *s="\123\n";
printf("%d",sizeof(s));
}
a)4 b)2 c)6 d)error
9.void main()
{
int i;
clrscr();
for(i=1;i<4;i++)
switch(i)
{
switch(i+1)
case 1: printf("%d",i);break;
{
case 2:printf("%d",i);break;
case 3:printf("%d",i);break;
}
switch(i);
}
}
a)23 b)error c)123 d)234
10.
struct student
{
Intsno;
Float fee;
floatwt;
}
main()
{
Structstudent s={100,2000.50};
Printf(“\n%d\t%f\t%f”,s.sno,s.fee,s.wt);
}
a)error b)100 2000.50 0.000000 c)100
2000.50 d)none
11.
union un
{
int no;
char name[20];
};
main()
{
Union un u;
u.no=100;
strcpy(u.name,”xxxx”);
printf(“%d%s”,u.no,u.name);
}
a)100 xxxx b)100 garbage c)error
d)garbage xxxx
12.
Intsquare(int x)
{
return x*x;
}
Which function pointer points statement is
correct to point above function.
a) Int (*fptr)(int) b)int (fptr*)
c)int (fptr)(int*) e)none
13.
typedef char names[20];
which statement is correct
a) Typedef names n; b)names n
c)names:n d)none
14.
update(int*p)
{
*p+=10;
}
main()
{
Int x=10;
update(&x);
printf(“%d”,x);
}
a)10 b)ref error c)20 d)20
15.
struct test
{
Int x;
Int y;
};
main()
{
struct test t[2];
test[0].x=test[0].y=10;
test[1]=test[0];
printf(“%d\t%d”,test[1].x,test[1].y);
}
a)error b)10 10 c)garbage values d)none
16. max2(inta,intb,charch)
{
}
main()
{
}
a)10 b)20 c)a d)97
17. enum color{RED,GREEN=3,BLUE};
main()
{
struct bfield
{
unsigned type:3;
};
struct bfield b;
b.type=BLUE;
printf("\n%d",b.type);
}a)4 b)3 c)5 d)error
18.# include <stdio.h>
main()
{ char*str="i love java";
char*s;
while(s!=NULL)
{
puts(s);
}
}
a)i love java b)error
c)i d)i
love
java
19.
# include <stdio.h>
main()
{
char*str="C_lang";
printf("\n%s",strchr(str,'l'));
}
a)C_ b)l c)lang d)none
20.
# include <stdio.h>
main()
{
char*str="C_lang";
printf("\n%s",memset(str,'x',4));
}
a)ng b)xxxxng c)0000ng d)x0ffng
21. struct a
{ struct b
{
}B;
int x;
};
main()
{
struct a A={100};
A.B.x=A.x=10;
a.x=111;
printf("\n%d",A.B.x);
}
a)100 b)10 c)error d)111
22.
main()
{
const int y=111;
int*x;
x=y;
printf("%d ",*x);
x=&y;
*x+=1;
int x;
printf("%d",*x);
}
a)111 112 b)address 112 c)error d)none
23.
main()
{
struct a
{ int x,y;
}z={10,20};
fun1(z);
}
fun1(struct a B)
{
B.x=100;
printf("%d",B.x);
}
a)100 b)10 c)error d)none
24.
main()
{
char *s[]={"ongole","chennaai","ooty"};
printf("\n%d",*(*(s+2)+1));
}
a)c b)99 c)error d)111
25.
main()
{
char *s1="c";
char*s2="c++";
clrscr();
printf("%c",*s1+*s2-76);
}
a)y b)z c)error d)z
1.#include<stdio.h>
int main(){
int no[2][2]={{0},{1,2}};
clrscr();
printf(‘%d’,no[0][0]);
}
a)0 b)nothing c)error d)1
2.#include<stdio.h>
int main()
{
int no[][3]={{0},{1,{2},3}};
clrscr();
printf("%d",no[0][0]);
}
a)error b)nothing c)0 d)3
3.#include<stdio.h>
int main()
{
int i=10;
int no[2][4]={1,0,2};
clrscr();
printf("%d",sizeof(no));
}
a)6 b)8 c)2 d)16
4.#include<stdio.h>
int main()
{
int i=-1;
int no[3][3]={{1,2,3},{4,5,6},{7,8,9}};
clrscr();
for(i++;i<=2;i++)
printf("%d,",0[no[i]]);
}a)1,2,3 b)1,5,9 c)1,4,7 d)
5.#include<stdio.h>
int main()
{
int i=-1;
int no[3][3]={{1,2,3},{4,5,6},{7,8,9}};
clrscr();
for(i++;i<=2;i++)
printf("%d,",1[0[no]]);
}
a)2,2,2 b)4,5,6 c)5,5,5 d)4,4,4
6.
main(){
char*str=”I love java”;
str=str+3;
printf(“%s”,str);
}
a.i love java b)error c)ove java d)ve java
7.
main(){
char*s[3]={”I love java”,”C++”,”MySQL”};
char**str;
str[0]=s[0];
printf(“%s”,s[0]);
}
a)error b)i love java c)I d)null
8.void main()
{
char *s="\123\n";
printf("%d",sizeof(s));
}
a)4 b)2 c)6 d)error
9.void main()
{
int i;
clrscr();
for(i=1;i<4;i++)
switch(i)
{
switch(i+1)
case 1: printf("%d",i);break;
{
case 2:printf("%d",i);break;
case 3:printf("%d",i);break;
}
switch(i);
}
}
a)23 b)error c)123 d)234
10.
struct student
{
Intsno;
Float fee;
floatwt;
}
main()
{
Structstudent s={100,2000.50};
Printf(“\n%d\t%f\t%f”,s.sno,s.fee,s.wt);
}
a)error b)100 2000.50 0.000000 c)100
2000.50 d)none
11.
union un
{
int no;
char name[20];
};
main()
{
Union un u;
u.no=100;
strcpy(u.name,”xxxx”);
printf(“%d%s”,u.no,u.name);
}
a)100 xxxx b)100 garbage c)error
d)garbage xxxx
12.
Intsquare(int x)
{
return x*x;
}
Which function pointer points statement is
correct to point above function.
a) Int (*fptr)(int) b)int (fptr*)
c)int (fptr)(int*) e)none
13.
typedef char names[20];
which statement is correct
a) Typedef names n; b)names n
c)names:n d)none
14.
update(int*p)
{
*p+=10;
}
main()
{
Int x=10;
update(&x);
printf(“%d”,x);
}
a)10 b)ref error c)20 d)20
15.
struct test
{
Int x;
Int y;
};
main()
{
struct test t[2];
test[0].x=test[0].y=10;
test[1]=test[0];
printf(“%d\t%d”,test[1].x,test[1].y);
}
a)error b)10 10 c)garbage values d)none
16. max2(inta,intb,charch)
{
}
main()
{
}
a)10 b)20 c)a d)97
17. enum color{RED,GREEN=3,BLUE};
main()
{
struct bfield
{
unsigned type:3;
};
struct bfield b;
b.type=BLUE;
printf("\n%d",b.type);
}a)4 b)3 c)5 d)error
18.# include <stdio.h>
main()
{ char*str="i love java";
char*s;
while(s!=NULL)
{
puts(s);
}
}
a)i love java b)error
c)i d)i
love
java
19.
# include <stdio.h>
main()
{
char*str="C_lang";
printf("\n%s",strchr(str,'l'));
}
a)C_ b)l c)lang d)none
20.
# include <stdio.h>
main()
{
char*str="C_lang";
printf("\n%s",memset(str,'x',4));
}
a)ng b)xxxxng c)0000ng d)x0ffng
21. struct a
{ struct b
{
}B;
int x;
};
main()
{
struct a A={100};
A.B.x=A.x=10;
a.x=111;
printf("\n%d",A.B.x);
}
a)100 b)10 c)error d)111
22.
main()
{
const int y=111;
int*x;
x=y;
printf("%d ",*x);
x=&y;
*x+=1;
int x;
printf("%d",*x);
}
a)111 112 b)address 112 c)error d)none
23.
main()
{
struct a
{ int x,y;
}z={10,20};
fun1(z);
}
fun1(struct a B)
{
B.x=100;
printf("%d",B.x);
}
a)100 b)10 c)error d)none
24.
main()
{
char *s[]={"ongole","chennaai","ooty"};
printf("\n%d",*(*(s+2)+1));
}
a)c b)99 c)error d)111
25.
main()
{
char *s1="c";
char*s2="c++";
clrscr();
printf("%c",*s1+*s2-76);
}
a)y b)z c)error d)z
No comments:
Post a Comment