Font size
WorksheetsC programming_Shivank
Total questions: 20
Worksheet time: 25mins
What is the minimum number of functions to be present in a C Program.?
1
2
3
4
What is the Priority among (*, /, %), (+, -) and (=) C Operators.?
(*, /, %) > (+, -) < (=)
(*, /, %) < (+, -) < (=)
(*, /, %) > (+, -) > (=)
(*, /, %) < (+, -)
What is the output of the C statement.?
int main()
{
int a=0;
a = 4 + 4/2*5 + 20;
printf("%d", a);
return 0;
}
40
4
34
54
Choose correct C while loop syntax.
while(condition) { //statements }
{ //statements }while(condition)
while(condition); { //statements }
while() { if(condition) { //statements } }
What is the output of C Program.?
int main()
{
while(true)
{
printf("RABBIT");
break;
}
return 0;
}
RABBIT
RABBIT is printed unlimited number of times.
No output
Compiler error.
What is the output of C Program.?
int main()
{
int a[];
a[4] = {1,2,3,4};
printf("%d", a[0]);
}
1
2
4
Compiler error
What is the output of C program.?
int main()
{
int a[3] = {10,12,14};
int i=0;
while(i<3)
{
printf("%d ", i[a]);
i++;
}
}
14 12 10
10 10 10
10 12 14
None of the above
Which character is used to indicate the end of the string?
Which one is not a reserve keyword in C Language?
auto
main
case
register
A pointer that is pointing to NOTHING is called ____
VOID Pointer
DANGLING Pointer
NULL Pointer
WILD Pointer
In C language, FILE is of which data type?
a) int
b) char *
c) struct
d) None of the mentioned
What is meant by ‘a’ in the following C operation?
fp = fopen("Random.txt", "a");
a) Attach
b) Append
c) Apprehend
d) Add
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int y = 10000;
int y = 34;
printf("Hello World! %d\n", y);
return 0;
}
a) Compile time error
b) Hello World! 34
c) Hello World! 1000
d) Hello World! followed by a junk value
What will this program print?
main()
{
int i = 2;
{
int i = 4, j = 5;
printf("%d %d", i, j);
}
printf("%d %d", i, j);
}
4525
2525
4545
None of the these
Study the following program:
main()
{
char x [10], *ptr = x;
scanf ("%s", x);
change(&x[4]);
}
change(char a[])
{
puts(a);
}
If abcdefg is the input, the output will be
abcd
abc
efg
Garbage
What is the difference between call by value and call by reference in c programming?
What are the differences between structures and union?
What is storage class.What are the different storage classes in C?
What is dynamic memory allocation?
Why is it necessary to give the size of an array in an array declaration ?
