Knowledge check.
- Choose one best answer from given 4 choices for each questions.
- Review before submit as you wont get a chance to review after submit.
- Max Time for quiz is 30 mins and Exam is 90 mins.
- Login is not required for an exam or a quiz.
- By submitting you formally acknowledge and accept terms and conditions mentioned here.
How can you deal with errors during compilation of a C program in VS?
Automatic variables are variables that are
Give the output of the following code snippet :
void main()
{
int a=13,b=20;
if(!a==!b)
printf("%d",++a);
else
printf("%d",--b);
}
Give the output of the following code snippet :
void main()
{
struct employee
{
int id;
} emp=10;
printf("%d\t",emp.id);
getch();
}
Give the output of the following code :
int main()
{
char str1[20] = "Hello", str2[20] = " World";
printf("%s\n", strcpy(str2, strcat(str1, str2)));
return 0;
}
Give the output of the following code :
void main()
{
char str1[]= {0};
printf(str1);
}
A function in C must always return a value. State true or false :
Which of the following is related to a Microsoft Development tool package.
Give the output of the following code snippet :
void main()
{
int k;
for (k = -3; k < -5; k++)
printf("Hello");
}
Which of the keywords denote the size and type of a variable in C :
Debugging helps in the following :
Give the output of the following code snippet :
void main()
{
int a=12,i=0;
--a;
while(!i)
{
printf("%d",a);
}
}
Which of the following statements are true regarding a function in C?
When is the increment statement(s) of the for loop executed?
Give the output of the following code snippet :
struct Point
{
int x;
int y;
};
int main()
{
struct Point p1;
struct Point p2 = p1;
printf("%d %d", p2.x, p2.y);
getchar();
}
Give the output of the following code snippet :
struct student
{
int id;
};
void main()
{
struct student s[10];
s.id[0] = 10;
printf("%d", s.id[0]);
}
The function declaration in C provides information to the compiler about :
Give the output of the following code snippet :
int main()
{
int i=0;
while(!i++)
{
printf("%d",i--+ ++i);
main();
return 0;
}
}
Give an example of a library function in C
Which of the following gives the memory address of the first element in array arr, an array with 10 elements?
Which of the following is related to a Microsoft Development tool package?
A function in C cannot return more than one value at once. State true or false :
Give the output of the following program :
void main()
{
int a=5, b=10;
if(a==5)&&if(b==10)
printf("Values match");
}
Which mode is used to denote opening the text file for update where the writing is done at the end?
Give the output of the following code snippet :
int main()
{
int fun(int);
int i = fun(10);
printf("%d\n", --i);
return 0;
}
int fun(int i)
{
return (i++);
}
Give the output of the following code :
struct p
{
int k;
char c;
};
int main()
{
struct p x = {0,1};
x.k=10;
printf("%d %d\n", x.k,x.c);
}
Which of the following functions control the buffering of the stream?
What is the range of the values allowed for the data type unsigned char in C:
If two strings are identical, then what does the strcmp() function return?
Visual Studio is NOT
Give the output of the following code snippet :
void main()
{
int i=0,j;
for(i=-1,j=2; j< 6; j++)
{
if(j!=5)
continue;
else i++;
}
printf("%d",i);
}
Which of the following is an example of loop in C?
Give the output of the following code snippet :
struct point
{
int x;
int y;
};
struct point fun()
{
struct point temp = {1, 2};
return temp;
}
int main()
{
struct point p1 = {10};
p1 = fun();
printf("%d\n", p1.x);
}
Give the output of the following code snippet :
int main()
{
int a = 0, i = 0, b;
for (i = 0; i < 5; i++)
{
a++;
if (i == 3)
break;
}
printf("%d %d",a,b);
}
Give the output of the following code snippet :
void main()
{
int n;
for (n = 4; n!=0; n--)
printf("%d ", n--);
}
Which of the following is NOT related to a Microsoft Development tool package?
Which of the keywords denote the size and type of a variable in C :
Give the output of the following code snippet :
int x = 5;
void main()
{
int x = 3;
printf("%d ", x);
{
x = 4;
}
printf("%d", x);
}
Give the output of the following code snippet :
void main()
{
int i = 2;
do
{
printf("Hi ");
}
while (i < 2)
}
A stream is connected to a file or device by :
Give the output of the following code snippet :
void main( )
{
float c;
c = getchar( );
printf( "\nYou entered: ");
putchar( c );
}
Assume input as 2.45 :
Give the output of the following snippet :
struct student
{
int no = 5;
char name[20];
};
void main()
{
struct student s;
s.no = 8;
printf("Hello");
}
Give the output of the following code snippet :
void func(int a,int b)
{
int z=a >= b?a= a/b:a=20%10;
printf("%d ",z);
}
int main()
{
func(100,250);
func(20,20);
}
Which of the following is a debugger :
Which of the following statements is true about the tmpfile() function?
Which of the keywords denote the size and type of a variable in C :
The nth element of an array arr[n] of n values is accessed by:
Give the output of the following code snippet :
int a=10;
void main()
{
int a=13,b=20;
if(!a!=b&&a==!b)
goto L1;
else
b--;
}
L1:
printf("%d",a);
Which of the following characters are printed by the ispunct() function defined in ctype.h?
Give the output of the following code snippet :
void main()
{
char new1 ='c';
if( new1 =='C') || if(new1 =='c')
printf("Same");
else
printf("Not Same");
}
Give the output of the following code snippet :
int main()
{
struct emp
{
char name[25];
int age;
};
struct emp e;
e.name = "Jenna";
e.age = 25;
printf("%s %d\n", e.name, e.age);
return 0;
}
Identify the type of error in the given code :
void main()
{
printf("Hello world");
printf(Test);
}
Which of the following are constituents of a C program :
Give the output of the following code snippet :
void main()
{
int i=3,x=10;
i++;
switch(i)
{
case 2:
printf("%d ",x++);
break;
case 3:
printf("%d ",x+2);
case 4:
printf("%d ",x+3);
default:
printf("Hello");
break;
}
}
What is the general syntax to call a function in C?
Which of the following statements is true about the fclose() function?
Name some of the basic errors that may occur during compilation of a C program :
What is Visual Studio?
What is a text stream in C?
Give the output of the following code snippet :
int main()
{
do
printf("In while loop ");
while (0);
printf("After loop\n");
}
Consider the given code snippet :
int main()
{
int i = 0;
while (i < 3)
i++;
printf("In while loop\n");
}
How many times is the value of 'i' checked in the condition i < 3?
Which of the following are the user interfaces that help to debug a program with Visual Studio:
Give the output of the following code :
struct p
{
char c;
float f;
};
int main()
{
printf("%c %f \n", c, f);
}
Which of the keywords denote the size and type of a variable in C :
Give the output of the following code snippet :
void demo();
int main()
{
demo();
return 0;
}
void demo()
{
printf("Hello ");
}
Which of the following is an example of loop in C?
Give the output of the following code snippet :
struct point
{
int x;
int y;
};
int main()
{
struct point p1 = {10};
p1 = fun();
printf("%d\n", p1.x);
}
struct point fun()
{
struct point temp = {1, 2};
return temp;
}
Give the output of the following code snippet :
void main()
{
float x=0.3;
float y=0.3;
if(x==y)
printf("%f",x+y);
else
printf("%f",x-y);
}
Which of the following statements is true about a minimal function in C?
In C, the keyword used to transfer control from a function back to the calling function is
What are the arguments that the fopen() function takes?
Which of the following are file positioning functions in C?
Give the output of the following code snippet :
int main()
{
int a,b;
int func(int,int);
a=func(100,250);
b=func(20,20);
printf("%d %d",a,b);
}
int func(int a,int b)
{
int z= a >= b?(a= a*b): (a=20/b) ;
return z;
}
Which of the following statements is true about the tmpnam() function?
Give the output of the following code snippet :
void main()
{
int a=13,b=20;
if(!a!=b&&a==!b)
printf("%d",++a);
else
printf("%d",--b);
}
Consider the following code snippet and give the output of the program :
main()
{
int a=12;
if(a==12);
printf("Input 1");
else
printf("Input other");
}
What is the return value of a strcmp() function?
Give the output of the following code snippet :
struct p
{
int k;
char c[10];
float f;
};
int p = 10;
int main()
{
struct p x = {1,"Hello"};
printf("%s %d\n", x.c, p);
}
Give the output of the following code snippet :
int x;
void main()
{
printf("%d", x);
}
Name the looping statements available in C :
Which mode is used to denote opening the binary file for update?
Give the output of the following code snippet :
struct point
{
int x;
int y;
};
void point fun()
{
struct point temp = {1, 2};
return temp;
}
int main()
{
struct point p1 = {10};
p1 = fun();
printf("%d\n", p1.x);
}
Which of the following are the user interfaces that help to debug a program with Visual Studio:
Identify the keyword(s) in the program
According to the presenter, to overcome the learning curve with Visual Studio, with ease, it’s better to
In which header file is the integer expression errno declared?
What is the return-type of the function sqrt() in C?
For a given C program, a function can be called :
What is integrated into Visual Studio?
Give the output of the following code snippet :
void main()
{
int x;
for(x=1; x< =3; x++);
printf("%d",x);
}
Which of the following statements is true by the Call by reference method?
Give the output of the following code snippet :
void main()
{
int i = 0;
while (++i)
{
printf("Ho");
}
}
Which is the function key in VS is associated with stepping out of the function while debugging?
Boiler plate code is auto-generated in Visual Studio by
Give the output of the following code snippet :
void main()
{
char new1 ='c';
if( new1 =='C')
printf("Same");
else
printf("Not Same");
}
Give the output of the following code snippet :
struct p
{
int mark1,mark2,mark3;
};
int main()
{
struct p x = {100};
printf("%d %d %d\n",x.mark1,x.mark2,x.mark3);
}
Give the output of the following code snippet :
void main()
{
static int x;
if (x++ < 2)
{
printf("Ho " );
main();
}
}
How can an array of strings be represented as?
Which of the following is a valid initialization of a multidimensional array?
Give the output of the following code snippet :
int main()
{
int a = 10, b;
a >=5 ? b=100: b=200;
printf("%d\n", b);
return 0;
}
Which of the following is not a debugger :
Give the output of the following code :
void main()
{
int var = strcmp("Yellow","Yellow");
printf("%d", var);
}
Which of the following statements in C stops execution of the loop but executes statements that immediately follow the loop?
Which of the keywords denote the scope of a variable in C :
Give the output of the following code :
int main()
{
int i=1;
if(!i)
printf("Hello,");
else
{
i=0;
printf("Jello");
main();
}
return 0;
}
Debugging allows you to :
Given the following code snippet, find the output of the program :
void main()
{
int a=5;
switch(a)
{
case 5;
printf("Value is 5");
break;
}
}
Give the output of the following code snippet :
int main()
{
int a = 1;
switch(a)
{
case 1:
printf("First");
case 2:
printf("Second");
case 3:
printf("Final");
break;
}
Which of the following are parts of a function in C:
Which of the following is a storage specifier?
What is integrated into Visual Studio?
Visual Studio is NOT
Which of the following functions is used to remove a named file?
Which of the following are constituents of a C program :
Write the given if else statements using conditional operator in C :
if (x < y)
{
min = x;
}
else
{
min = y;
}
Which of the following statements is not true about the fclose() function?
Give the output of the following code :
void main()
{
int var = strcmp("Hello","World");
printf("%d", var);
}
Give the output of the following code :
void main()
{
int var = strcmp("Yellow","World");
printf("%d", var);
}
Which of the following is a valid string definition?
Give the output of the following code snippet :
int func2(int y)
{
if(y==1)
return 1;
int x=20;
x+=func2(--y);
return x;
}
void main()
{
int i=10;
int b=func2(i);
printf("%d",b);
}
Which of the following statements indicate the general nature of computer programs?
What are the functions that are available to manipulate strings in C?
What is the green play button in the Visual studio does?
Give the output of the following code snippet :
void countFun ( int count )
{
if ( count < = 5 )
{
printf(" %d ", count);
countFun( count + 1 );
}
}
int main()
{
countFun ( 2 );
}
Give the output of the following code snippet :
int main()
{
int i;
for(i=0; i< =6; i++)
{
if(i < 3)
continue;
else
break;
printf("Test");
}
return 0;
}
Give the output of the following code snippet :
void main()
{
static double x;
int x;
printf("x is %d", x);
}
For a 32 bit float number with 6 significant bits, the magnitude lies between :
Which of the following functions are available in the header file string.h in C?
Which of the keywords denote the size and type of a variable in C :
Give the output of the following code snippet :
int main()
{
int i;
for(i=0; i< =6; i++)
{
if(i < 3)
continue;
else
printf("Test");
break;
}
return 0;
}
Give the output of the following code snippet :
int main()
{
while()
{
printf("Hello world");
}
return 0;
}
Give the output of the following code snippet :
int main()
{
int i=0;
while(!i++)
{
printf("%d",i--+ ++i);
return 0;
main();
}
}
Which of the following statements is true about an escape sequence in C?
Give the output of the following code snippet :
int func2(int y)
{
if(y==1)
return 1;
func2(--y);
}
void main()
{
int i=10;
int b=func2(i);
printf("%d",b);
}
Name the function key associated with debugging an application in Visual Studio :
Which of the following is a debugger :
Which of the following is a valid array declaration in C ?
Development tools are normally NOT used for,
Which of the following statements is true about Strings in C :
Which of the following statements are true about keywords in C?
Which is the function used to compare two strings in C?
Which of the following functions is used to get the current position for file stream?
Give the output of the following code :
int main()
{
int i=5;
while(i)
{
printf("Hello world");
}
return 0;
}
Give the output of the following code snippet :
struct p
{
int k;
char c;
};
int p = 10;
int main()
{
struct p x;
x.c = 'B';
printf("%d %d\n", x.c, p);
}
Given the following code snippet, find the output of the program :
void main()
{
int a=5;
switch(a)
{
case 1:
printf("Value is 5");
break;
}
}
Which of the following are keywords in C:
Which of the following modes is used to indicate no buffering in the setvbuf() function?
Show the correct order of execution for creating and executing a program in Visual Studio:
What are the types of functions that can be used in C?
Which of the following are the user interfaces that help to debug a program with Visual Studio:
Which of the following are file positioning functions in C?
Give the syntax for the do-while loop in C :
Which of the following statements is true about structures in C?
Give the output of the following code snippet :
float func()
{
int i=10;
if(i< =0)
return 10.50;
else
return 20.75;
}
int main()
{
float a=func();
printf("%.2f",a);
}
Give the output of the following code snippet :
int main()
{
int a,b;
int func(int a,int b);
a=func(100,250);
b=func(20,20);
printf("%d %d",a,b);
}
int func(int a,int b)
{
int z;
return a >= b?(a= a/b): (a=20/b) ;
}
Give the output of the following code snippet :
int main()
{
int i=0;
while(!i)
{
printf("%d",i++);
main();
}
}
Which of the following statements is true with regards to the break statement :
Give the output of the following code snippet :
int func(int a,int b)
{
int i=100;
if(i++< =100)
return 20;
else
return 30;
}
int main()
{
int z=func(100,200);
printf("%d ",z);
printf("%p",main);
}
Which of the following is related to a Microsoft Development tool package.
Give the output of the following code snippet :
void main()
{
char i='d';
if((i=='d') && (i=='D'))
printf("Values match");
else
printf("No match");
}
Give the output of the following code snippet :
func(int a)
{
int i=10;
if(i< =0)
return a++;
}
func(int a)
{
int i=10;
if(i< =0)
return a+10;
}
int main()
{
float a=func(10*5+5);
printf("%.2f",a);
}
Give the output of the following code snippet :
void main()
{
int x=0,y=1,z=2;
x+y-z>10?x=100:y=200;
if(x==100||y==200)
printf("%d",2^x);
else
printf("%d",2^y);
}
Which of the keywords denote the size and type of a variable in C :
Which of the following statements is true about a minimal function in C?
Give the output of the following code snippet :
int func(int a)
{
int b=10,i=0;
while(a!=0)
{
int c=a+b;
a--;
b--;
}
printf("%d ",c);
return 0;
}
int main()
{
int x=5;
func(x);
}
Give the output of the following code snippet :
int main()
{
int i=0;
for(i=0; i< 5; i++)
{
if((i==2)||(i==4))
continue;
printf("Ho");
}
printf("Hello World");
}
Give the output of the following code snippet :
void main()
{
int x=0,y=1,z=2;
if((x==y)&(z==x+2))
printf("%d",z);
else
printf("%d",++x);
}
Give the output of the following code snippet :
void main()
{
int i=0;
do
{
i=i+3;
printf("%d",i);
}
while(1);
}
Which of the following is a valid string definition?
Which of the following are constituents of a C program :
Give the output of the following code snippet :
struct student
{
int mark1;
int mark2;
} p[] = {0};
void main()
{
printf("%d", sizeof(p));
}
Give the output of then following code snippet :
int main()
{
int x,y=5;
for(x=0; x< 3; x++)
if(y>=5)
printf(" %d",x);
return 0;
}
Give the output of the following code snippet :
void main()
{
int i = 0;
for (i = 0; i < 3; i++)
{
if (i > 1)
break;
printf("Ho ");
}
}
Give the output of the following code snippet :
struct Point
{
int x;
int y;
};
int main()
{
struct Point p1 = {10, 20};
struct Point p2 = p1;
if (p1 == p2)
printf("p1 and p2 are same ");
}
Which of the following are parts of a function in C:
Visual Studio has
Which of the following statements are used to alter the flow of control in a C program :
Which of the following statements is true about the fclose() function?
The conditional operator can be used to replace which condition statement in C?
Breakpoints do not allow you to :
Give the output of the following code snippet :
int a=10;
void func()
{
L1:
printf("%d",a);
}
void main()
{
int a=13,b=20;
if(!a!=b&&a==!b)
goto L1;
else
b--;
}
What are the arguments passed to the fwrite() function?
When is the condition statement in a for loop checked in C?
Give the output of the following code snippet :
void main()
{
int x=0,z;
float p=2.4567;
float q=5.6543;
float r=0.0;
printf("%6.2f",p+q-r);
}
Give the output of the following code snippet : Assume the contents of the file 'Test.txt' is "Hello World".
void main()
{
char x;
FILE *fp;
fp=fopen("Test.txt","r");
while((x=getc(fp))!=EOF)
{
}
printf("%c",x);
fclose(fp);
}
Give the output of the following code snippet :
int main()
{
struct value
{
int mark1;
int mark2;
} val= {10,20};
printf("%d %d\n", val.mark1,val.mark2);
}
Which keyword in C does not change the number of iterations which could have been executed by the condition?
Give the output of the following code snippet :
register int x;
void main()
{
printf("%d", x);
}
Which of the following is an example of looping in C?
Which of the following statements is true about the setvbuf() function?
Which of the keywords denote the size and type of a variable in C :
How many elements can the array arr[10][5] hold?
Give the output of the following code snippet :
void main()
{
int x=0,z;
float p=2.4567;
float q=5.6543;
float r=0.0;
printf("%4.4f",p+q-r);
}
Give the output of the following code snippet :
int main()
{
int k, num = 30;
k = (num < 10) ? 100 : 200;
printf("%d\n", num);
return 0;
}
Give the output of the following code snippet :
void func(int a)
{
int sum=0,x,a=10;
while(a!=0)
{
x=a%100;
sum+=(x+x+x);
a=a/10;
}
printf("%d ",sum);
}
int main()
{
func(1000);
func(2222);
}
Give the output of the following code snippet :
int main()
{
void Fun();
printf("1 ");
Fun();
}
void Fun()
{
printf("2 ");
}
Which of the keywords denote the size and type of a variable in C :
Which of the keywords denote the size and type of a variable in C :
Give the output of the following code snippet :
struct test
{
int k;
char c;
float f;
};
int var=10;
int main()
{
struct test var = {5,80};
printf("%f\n", var.f);
}
Give the output of the following code snippet :
void fun()
{
return 1;
}
void main()
{
int x = 0;
x = fun();
printf("%d", x);
}
Which of the keywords denote the scope of a variable in C :
Give the output of the following code snippet :
void main()
{
struct employee
{
int id;
};
struct employee emp1= {20};
printf("%d\t",emp1.id);
}
Which of the following operators performs the same function of the logical OR operator?
Which of the following statements is true about Strings in C :
Visual Studio is NOT
Give the output of the following code snippet :
int func(int,float);
int main()
{
float a,b;
a=func(100,250.5);
b=func(20,20.75);
printf("%.2f %.2f",a,b);
}
int func(int a,float b)
{
return ((float)a+b);
}
Which of the following statements in C completely skips the particular iteration of the loop but starts the next iteration?
Give the output of the following code snippet :
void main()
{
int x=0,y=1,z=2;
x+y+z>1?x=10:y=20;
if(x==10||y==20)
printf("%d",10*x);
else
printf("%d",20*y);
}
Which of the following statements are used to alter the flow of control in a C program :
Give the output of the following code snippet :
struct Point
{
int x;
int y;
};
int main()
{
struct Point p1 = {10, 20};
struct Point p2 = p1;
if (p1.x == p2.x)
printf("p1 and p2 are same ");
}
What are the functions that are available to manipulate strings in C?
Which of the following functions is used to create a temporary name?
Which of the following operators performs the same function of the logical AND operator?
Give the output of the following code :
void fun (int)
{
printf("Hello");
}
void main()
{
fun();
}
Versions of Visual Studio are,
Give the output of the following code snippet :
struct test
{
int k;
char c;
float f;
};
int main()
{
struct test var = {5,80,2.0};
printf("%c\n", var.c);
}
Versions of Visual Studio are,
The main function in a given program cannot be called recursively. State true or false :
Property of external variable to be accessed by any source file is called as
Give the output of the following snippet :
struct student
{
int no;
char name[20];
};
void main()
{
student s;
s.no = 8;
printf("%d", s.no);
}
Which of the following is an example of looping in C?
Which of the following are keywords in C:
Give the output of the following code snippet :
void main()
{
int i=0;
for(;; i++)
{
i=i+2;
if(i%2==0)
continue;
else
break;
}
printf("%d",i);
}
Platforms and software supported by Visual Studio are,
Platforms and software supported by Visual Studio are,
Which of the keywords denote the size and type of a variable in C :
Give the output of the following code snippet :
void main()
{
char new1[]= { 0 };
strcpy(new1,"Jello");
char new2[]= { 0 };
strcpy(new2,"Yellow");
char new3[]= { 0 };
strcat(new3,new1);
strcat(new3,new2);
printf (new3);
}
Give the syntax for the for loop in C :
Wizard in Visual studio is normally a set of,
Identify the type of error in the given code :
void main()
{
int a = 10;
{
printf("Hello world");
printf("%d",a);
}
Name some of the basic errors that may occur during compilation of a C program in VS:
Give the output of the following code snippet :
void main()
{
static int x;
printf("x is %d", x);
}
Which is the function used to copy a particular string into an array in C?
Consider the given code snippet in C. What is the output of the program :
void hello();
int a1=10;
void main()
{
int a1=20;
printf("%d",a1);
}
Which of the keywords denote the size and type of a variable in C :
Development tools are normally NOT used for,
The rewind(fp) function is equivalent to which of the following functions?
The steps to start a New Wizard in Visual Studio 2010 is,
Give the output of the following code snippet :
struct student
{
int no;
char name[20];
}
void main()
{
struct student s;
s.no = 8;
printf("Hello");
}
Give the output of the following code snippet :
int main()
{
int i=0;
if(i--)
{
printf("%d",i++);
main();
}
else
printf("%d",--i);
}
Which of the following are the user interfaces that help to debug a program with Visual Studio:
What are the arguments passed to the fread() function?
Which is the function key in VS is associated with passing the control to the function definition to debug it using breakpoint:
Which of the following is a valid syntax for the sscanf() function?
Versions of Visual Studio are,
What is Visual Studio?
Give the output of the following code snippet :
void main()
{
int a=12,i=1;
int n2=printf("%d",a);
for(; n2!=2;)
{
printf("%d",--i);
}
}
Give the output of the following code snippet :
int m();
void main()
{
int k = m();
printf("%d", k);
}
int m()
{
int a[2] = {5, 8};
return a[0];
}
Which mode is used to denote opening the text file for writing, where the writing is done at the end?
Visual Studio has
Give the output of the following code snippet :
void main()
{
int a=12,i=0;
--a;
i++;
do
{
printf("%d",a);
++i;
}
while(--i);
}
Which is the function used to concatenate two strings in C?
Give the output of the following code snippet :
int main()
{
FILE *fp1,*fp2;
fp1=fopen("day.text","r");
fp2=fopen("night.txt","r");
fclose(fp1,fp2);
return 0;
}
Which of the following is related to a Microsoft Development tool package.
Give the output of the following code snippet :
void main()
{
int a=13,b=20;
if(!a!=b)
printf("%d",++a);
else
printf("%d",--b);
}