Professional Documents
Culture Documents
void show()
{
printf("Tutorial Links");
}
show();
return 0;
}
a)Compile time error
b)Tutorial Links
c)Run Time Error
d)None of the above
answer :b
9. It is necessary to declare the type of a function in the calling program if the function
a)Both B and C
b)Is not defined in the same file
c)Returns a non-integer value
d)None of the above
answer:c
35) What is the maximum number of statements that can present in a C function.?
A) 64
B) 128
C) 256
D) None of the above
Answer:D
39) What do you call STAR * and Ampersand & in a c program context.?
int a=10, *p;
p = &a;
printf("%d %d", a, *p);
A) * = ADDRESS OF operator, & = VALUE AT operator
B) * = ADDRESS OF operator, & = ADDRESS OF operator
C) * = VALUE AT operator, & = ADDRESS OF operator
D) * = VALUE AT operator, & = VALUE AT operator
Answer:C
int main()
{
printf("funny=%d" , funny());
return 0;
}
funny()
{
}
A) funny=
B) funny=1
C) funny=0
D) Compiler error
Answer:C
}
A) funny2=
B) funny2=0
C) funny2=1
D) Compiler error
Answer:D
48) What is the default return value of a C function if not specified explicitly.?
A) -1
B) 0
C) 1
D) None of the above
Answer:C
51) What is the output of C Program with arrays and pointers.? int main() { int a[3] = {20,30,40}; int
(*p)[3]; p=&a; printf("%d", (*p)[0]); }
A) 20
B) 0
C) address of element 20
D) Compiler error
ANS:A
52) What is the output of C program with arrays and pointers.? int main() { int a[3] = {20,30,40}; int
*p[3]; p=&a; printf("%d", *p[0]); }
A) 20
B) address of element 20
C) Garbage value
D) Compiler error
ANS:D
53) What is the output of C program with arrays and pointers.? int main() { int a[3] = {20,30,40};
printf("%d", *(a+1)); }
A) 20
B) 30
C) 40
D) Compiler error
ANS:B
55) What is the output of C Program with arrays and pointers.? void change(int[]); int main() { int
a[3] = {20,30,40}; change(a); printf("%d %d", *a, a[0]); } void change(int a[]) { a[0] = 10; }
A) 20 20
B) 10 20
C) 10 10
D) 20 30
ANS:C
int main()
{
structure hotel
{
int items;
char name[10];
}a;
strcpy(a.name, "TAJ");
a.items=10;
printf("%s", a.name);
return 0;
}
A) TAJ
B) Empty string
C) Compiler error
D) None of the above
Answer C
int main()
{
struct book
{
int pages;
char name[10];
}a;
a.pages=10;
strcpy(a.name,"Cbasics");
printf("%s=%d", a.name,a.pages);
return 0;
}
A) empty string=10
B) C=basics
C) Cbasics=10
D) Compiler error
Answer :C
};
return 0;
}
A) It is wrong to define an empty structure
B) Member variables can be added to a structure even after its first definition.
C) There is no use of defining an empty structure
D) None of the above
Answer: C
int main()
{
struct ship
{
int size;
char color[10];
}boat1, boat2;
boat1.size=10;
boat2 = boat1;
printf("boat2=%d",boat2.size);
return 0;
}
A) boat2=0
B) boat2=-1
C) boat2=10
D) Compiler error
Answer C
68) What is the output of C program with structures.?
int main()
{
struct ship
{
char color[10];
}boat1, boat2;
strcpy(boat1.color,"RED");
printf("%s ",boat1.color);
boat2 = boat1;
strcpy(boat2.color,"YELLOW");
printf("%s",boat1.color);
return 0;
}
A) RED RED
B) RED YELLOW
C) YELLOW YELLOW
D) Compiler error
Answer:A
int main()
{
struct tree
{
int h;
}
struct tree tree1;
tree1.h=10;
printf("Height=%d",tree1.h);
return 0;
}
A) Height=0
B) Height=10
C) Height=
D) Compiler error
Answer B
int main()
{
struct tree
{
int h;
int w;
};
struct tree tree1={10};
printf("%d ",tree1.w);
printf("%d",tree1.h);
return 0;
}
A) 0 0
B) 10 0
C) 0 10
D) 10 10
Answer C
int main()
{
struct tree
{
int h;
int rate;
};
struct tree tree1={0};
printf("%d ",tree1.rate);
printf("%d",tree1.h);
return 0;
}
A) 0 0
B) -1 -1
C) NULL NULL
D) Compiler error
Answer A
int main()
{
struct books{
int pages;
char str[4];
}b;
printf("%d",sizeof(b));
return 0;
}
A) 5
B) 6
C) 7
D) 8
AnswerB
int main()
{
struct books{
int pages;
char str[4];
}*ptr;
printf("%d",sizeof(ptr));
return 0;
}
A) 2
B) 6
C) 7
D) 8
Answer B
78) In a nested structure definition, with country.state.district statement, memeber state is actually
present in the structure.? (COUNTY, STATE, DISTRICT structures)
A) district
B) state
C) country
D) None of the above
Answer C
87) Which operator connects the structure name to its member name?
a) –
b) <-
c) .
d) Both <- and .
Answer: c
95. Which of the following are themselves a collection of different data types?
a.string
b.structures
c.char
d.all of the mentioned
Answer: (b)
125. Which among the following is wrong for “register int a;”?
a) Compiler generally ignores the request
b) You cannot take the address of this variable
c) Access time to a is critical
d) None of the mentioned
Answer: d