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.
Give the output of the following code snippet :
int main()
{
register static int i = 10;
i = 11;
printf("%d\n", i);
}
Which of the following is true for static variable?
Which of the following are constituents of a C program :
What is Integrated into Visual Studio?
Give the output of the following code snippet :
void main()
{
int a=300,b=20,c=50;
if(a % b == c % 2)
a=10;
else
c=40;
a=50;
printf("%d %d %d",a,b,c);
}
Give the output of the following code snippet : Assume the input given in 100.
void main()
{
int x=0,z;
z=printf("%d ",scanf("%d ",&x));
printf("%d",z);
}
Give the output of the following code snippet :
void main( )
{
printf("Hello,
World ");
}
Give the output of the following code snippet :
int main()
{
int i;
for (i = 1; i !=6; i += 2)
printf("Ho ");
return 0;
}
Which of the following modes is used to indicate full buffering in the setvbuf() function?
Which of the following functions flushes all the output streams?
If two strings are identical, then what does the strcmp() function return?
Which of the following statements is true about the remove() function?
Give the output of the following code snippet :
void main()
{
int a=12;
a==12?a=0:a=1;
printf("%d",a);
}
When is the condition statement in a for loop checked in C?
Give the output of the following code snippet :
int k()
{
printf("Hello");
}
struct p
{
int k();
char c[10];
};
int main()
{
struct p x;
printf("%d",x.k());
}
Give the output of the following code snippet :
int main()
{
char c;
FILE *fp;
fp=fopen("myfile.txt","w");
while((c=fgetc(fp))!=EOF)
printf("%c",c);
fclose(fp);
return 0;
}
Assume the contents of file 'myfile.txt' contains " Hello world".
Name the feature used in Visual Studio to help debugging.
Which of the following modes is the temporary file opened in?
Which mode is used to denote opening the text file for update?
Versions of Visual Studio are,
The steps to start a New Wizard in Visual Studio 2010 is,
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 functions control the buffering of the stream?
Given the following code snippet, find the output of the program :
void main()
{
int a=5;
switch(5)
{
case 1:
printf("Value is 5");
break;
case 5:
printf("Value is 1");
break;
}
}
Give the output of the following code snippet :
struct student
{
int no;
};
void main()
{
struct student s;
no=10;
printf("%d",no);
}
Which of the following are the user interfaces that help to debug a program with Visual Studio:
Which of the keywords denote the size and type of a variable in C :
Give the output of the following code snippet :
struct p
{
int k;
char c;
};
int main()
{
struct p x[5];
x[0].k=10;
x[0].c='a';
printf("%d %d\n", x.k,x.c);
}
Give the output of the following code snippet :
int main()
{
for(int i=0; i< =4; i++)
{
printf("%d ",i);
}
return 0;
}
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 output of the following code snippet :
void main()
{
int x=25,y=1;
do
{
if(x>5)
printf(" One");
else if(x>10)
printf(" Two");
else
printf(" Three");
}
while(y--);
}
Which of the following statements is true about structures in C?
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);
}
What does the fclose() function take as the argument?
Give the output of the following code snippet :
int func(int a,int b)
{
int i=100;
if(i++< =100)
return 20;
return 30;
}
int main()
{
int z=func(100,200);
printf("%d",z);
}
Consider the given C code:
main()
{
int val=30;
float val1=3.15;
printf("Welcome to the test");
}
Identify the literals in the program
Give the output of the following code snippet :
void main()
{
int x=0,y=0,z=2;
x+y+z>0?x=10:y=20;
if(x&&y)
printf("%d",10*x);
else
printf("%d",20*y);
}
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 );
}
Which of the following statements is true about Strings in C :
Give the output of the following code :
void main()
{
int var = strcmp("Worlc","World");
printf("%d", var);
}
Which of the following statements are used to alter the flow of control in a C program :
Consider the given code snippet in C. What is the output of the program?
int a1=10;
void main()
{
printf("%d",a1);
printf(" %d",b1);
}
int b1=12;
Give the output of the following code snippet :
int main()
{
int i;
int arr[4] = {1};
for (i = 0; i < 4; i++)
printf("%d ", arr[i]);
return 0;
}
Name the looping statements available in C :
Which of the following statements is true about the setvbuf() function?
Which function causes the buffered but unwritten data to be written to the file on an output stream C?
Which of the following are file positioning functions in C?
Debugging allows you to :
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");
}
Which of the following statements are used to alter the flow of control in a C program :
Breakpoints allow you to :
Breakpoints allow you to :
Give the output of the following code snippet :
void main()
{
static int x;
printf("x is %d", x);
}
Give the output of the following code snippet :
int func(int a)
{
int b=10;
return a+++ ++b;
}
int main()
{
int x=5;
int z=func(func(func(func(5))));
printf("%d",z);
}
Which function is used to position the stream at the position recorded by fgetpos() function?
When is the increment statement(s) of the for loop executed?
Give the output of the following code snippet when the file 'Test.txt' is not available :
void main()
{
char x;
FILE *fp;
fp=fopen("Test.txt","r");
if(fp==NULL)
{
printf("Fail");
exit(0);
}
fclose(fp);
}
Which of the following statements is true about the tmpnam() function?
Give the output of the following code snippet :
void main()
{
struct temp
{
int a;
char b;
struct temp1
{
char c;
} p;
};
struct temp t1 = {10,'A','e'};
printf("%d %c %c ",p.a,p.b,p.c);
}
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);
}
Give the output of the following code snippet :
void test();
void main()
{
test();
test();
}
void test()
{
static int x = 5;
x++;
printf("%d", x);
}
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);
}
Give the output of the following code snippet :
int main()
{
int a,b;
void func(int a,int b);
a=func(100,250);
b=func(20,20);
printf("%d %d",a,b);
}
void func(int a,int b)
{
int z= a >= b?(a= a/b): (a=20/b) ;
printf("%d",z);
}
Which of the keywords denote the size and type of a variable in C :
Give the output of the following code snippet :
void main()
{
int a=10;
switch(a)
{
case 10 :
printf("%d",a);
continue;
case a:
printf("%d",a++);
break;
printf("%d",a);
}
}
Following is a challenge with Visual studio for a beginner,
Which of the following steps are required to execute a C program in Visual Studio?
What are the arguments passed to the fwrite() function?
Give the output of the following code snippet :
void main()
{
register int x;
printf("%d", x);
}
Give the output of the following code :
struct p
{
char c;
float f;
};
int main()
{
printf("%c %f \n", c, f);
}
Give the output of the following C code:
void hello()
{
printf("Welcome");
}
void main()
{
hello();
printf("I repeat");
hello();
}
What is the return type of the character testing functions defined in ctype.h?
Versions of Visual Studio are,
Name the looping statements available in C :
What is the green play button in the Visual studio does?
Give the output of the following code snippet :
struct p
{
int k;
char c;
};
int main()
{
struct p x = {10,100};
x.k=5;
printf("%d %c\n", x.k,x.c);
}
Name some of the problems associated with goto statement :
Which is the function used to copy a particular string into an array in C?
Give the output of the following code snippet :
int x;
void main()
{
printf("%d", x);
}
Give the output of the following code snippet :
int main()
{
char c;
FILE *fp;
fp=fopen("myfile.txt","r");
while((c=fgetc(fp))!=EOF)
printf("%c",c);
fclose(fp);
return 0;
}
Assume the contents of file 'myfile.txt' contains " Hello world".
If the return type of a function is not mentioned, what is its default return type?
Which of the following functions is used to rename a particular file?
Give the output of the following code snippet :
void main()
{
int a=10;
switch(a--)
{
case 10 :
printf("%d ",a);
case 9 :
printf("%d ",a++);
printf("%d ",a);
}
}
Identify the type of error in the given code :
void main()
{
int a = 10;
{
printf("Hello world");
printf("%d",a);
}
Give the output of the following code snippet :
void main()
{
int a=10;
a--;
switch(a)
{
case 10 :
printf("%d",a);
break;
case 9 :
printf("%d",a++);
break;
printf("%d",a);
}
}
Which of the following are the user interfaces that help to debug a program with Visual Studio:
Which of the following steps are required to execute a C program in Visual Studio?
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);
}
Which of the following statements is true about Strings in C :
Which is the function used to concatenate two strings in C?
Give the output of the following code snippet :
void main()
{
int a=13;
if(a==12)
{
a==12?a=0:a=1;
if(a==0)
a++;
else
a--;
}
else
a-2;
printf("%d",a);
}
Give the output of the following code snippet :
void main()
{
int i;
for(i=0; i< =6; i=1+2)
{
if(i < 3)
{
continue;
printf("Test1 ");
}
else
{
break;
printf("Test2");
}
}
}
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 ");
}
}
Which mode is used to denote opening the text file for update where the writing is done at the end?
A function in C cannot return more than one value at once. State true or false :
The conditional operator can be used to replace which condition statement in C?
A new C program can be executed without being compiled . True or False?
Which of the following methodologies are used to control the flow of the program in C?
Which of the following are the user interfaces that help to debug a program with Visual Studio :
A function can be used as a parameter for another function. State true or false :
Give the output of the following code snippet :
int main()
{
int i;
for(i=0; i< =2; i++)
{
int i=5;
printf("%d ",i);
}
printf("%d",i);
return 0;
}
Give the output of the following code snippet :
struct p
{
int k;
char c;
};
int main()
{
struct p x[5];
x[0].k=15;
x[0].c='B';
printf("%d %c\n", x[0].k,x[0].c);
}
Which of the following is related to a Microsoft Development tool package.
Breakpoints allow you to :
Which of the following is a valid array declaration in C ?
Which of the following is NOT related to a Microsoft Development tool package?
Which of the following are not features of Debugging with Visual Studio :
Give the output of the following program :
void main()
{
int a=5, b=10;
if(a==5)&&if(b==10)
printf("Values match");
}
Give the output of the following code snippet :
int main()
{
for (int i = 0; i < 1; i++)
printf("In the loop");
}
Give the output of the following code snippet :
void main()
{
printf("Welcome");
goto L2 ;
L1:
printf("Loop 1");
L2:
printf("Loop2");
goto L1;
}
When the breakpoint is placed at a particular line, the execution of the code is :
Which of the keywords denote the size and type of a variable in C :
Give the output of the following code snippet :
void main( )
{
int c;
c = getchar( );
printf( "\nYou entered: ");
putchar( c );
}
Assume input as 6 :
Give the output of the following code snippet :
int func(int a*b)
{
int i=10;
if(i< =0)
return a+10;
}
int main()
{
float a=func(10*5+5);
printf("%.2f",a);
}
Versions of Visual Studio are,
Which of the following is a valid syntax for the function freopen()?
Which of the following are constituents of a C program :
What is a text stream in C?
In C, if you pass an array as an argument to a function, what actually gets passed?
Which mode is used to denote opening the binary file for writing, where the writing is done at the end?
Which of the following functions are required to access and create a file in C?
Wizard in Visual studio is normally a set of,
Give the output of the following code snippet :
void func()
{
int i=1;
while(!i)
{
func();
}
printf("%d",i++);
}
void main()
{
func();
}
What is integrated into Visual Studio?
Which is a Visual Studio edition.
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);
}
Which of the following statements is not true about the tmpfile() function?
Which library function in C is used to print a single character every time it is called?
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;
}
Give the output of the following code snippet :
void main()
{
int a=12;
--a;
switch(a--)
{
case 10 :
printf("%d ",a);
break;
case 10*9/10 :
printf("%d ",a++);
case 11:
printf("%d",a--);
break;
default:
printf("Hello");
break;
}
}
Visual Studio has
Name the function key associated with setting up a breakpoint in VS :
Which of the following statements is an example of an array initialization in C?
Give the output of the following code snippet :
int func(int a,int b)
{
int z;
return a >= b?(a= a/b): (a=20/b) ;
}
int main()
{
int a,b;
a=func(100,250);
b=func(20,20);
printf("%d %d",a,b);
}
Which library function in C is used to read a single character from the text stream and returns its value?
Give the output of the following code snippet :
struct test
{
int k;
char c;
float f;
};
int main()
{
struct test var = {5,80};
printf("%f\n", var.f);
}
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);
}
What is the use of the compiler error code when an error occurs in a C program in VS?
When a program begins execution, which of the following streams are open?
How many arguments are passed to the strlen function for string manipulation in C?
Which of the following statements is true by the Call by reference method?
Which of the following is not a debugger :
If the fopen() function is not able to open a file, then what does it return?
How many arguments does the getchar() function take?
How many arguments does the function fopen() take?
Wizard in Visual studio is normally a set of,
Give the output of the following code snippet :
void main()
{
int i=5;
do
printf("Hello world");
while(!i);
}
Give the output of the following code snippet :
void main()
{
struct temp
{
int a;
char b;
struct temp1
{
char c;
} p;
};
struct temp t1 = {10,'A','e'};
printf("%d %c %c ",t1.a,t1.b,p.c);
}
The steps to start a New Wizard in Visual Studio 2010 is,
Which of the following statements is true about the EOF character in C?
A function in C must always return a value. State true or false :
Which function prints an error message corresponding to integer in errno ?
Give the output of the following code snippet :
void main()
{
int arr[10]= {5};
printf("%d %d",arr[1],arr[9]);
}
Give the output of the following code snippet :
void main()
{
int i=3,x=10;
i++;
switch(i)
{
case2:
printf("%d ",x++);
break;
case3:
printf("%d ",x+2);
case4:
printf("%d ",x+3);
default:
printf("Hello");
break;
}
}
Give the output of the following program :
struct emp
{
char n[10];
int age;
};
void main()
{
struct emp e1 = {"Hello", 23};
struct emp e2 = e1;
printf("%s\n", e2.n);
}
Which of the following is related to a Microsoft Development tool package.
Give the output of the following code snippet :
int main()
{
int i=0;
if(!i)
{
printf("%d",i++);
main();
}
else
printf("%d",--i);
}
In which header file is the integer expression errno declared?
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;
}
}
Give the output of the following code snippet :
void main()
{
int a=12;
--a;
if(a)
{
}
printf("%d",a);
}
Which of the following correctly accesses the seventh element stored in arr, an array with 10 elements?
Give the output of the following code snippet :
int func()
{
int i=10;
if(i!=0)
return 10;
else
return 20;
}
int main()
{
int a=func();
printf("%d",a);
}
Following is a challenge with Visual studio for a beginner,
Which of the keywords denote the size and type of a variable in C :
For a 32 bit float number with 6 significant bits, the magnitude lies between :
Write the given if else statements using conditional operator in C :
if (x < y)
{
min = x;
}
else
{
min = y;
}
Which of the following are constituents of a C program :
Which of the following statements is true about the fopen function?
Which of the following operators performs the same function of the logical AND operator?
Which among the following is the correct syntax to declare a variable as static and register?
Identify the type of error in the given code :
void main()
{
printf("Hello world");
printf(Test);
}
Which of the following statements is true about an escape sequence in C?
What is the return type of the getchar() function?
In which header file is the EOF character defined in C?
Which of the following parts of a function are required when calling a function:
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);
}
The function declaration in C provides information to the compiler about :
Give the output of the following code snippet :
void main()
{
int a=10;
switch(a)
{
case 10 :
printf("%d",a);
break;
case a:
printf("%d",a++);
break;
printf("%d",a);
}
}
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 temp = 100;
switch(temp)
{
case 10 :
printf("10");
break;
case 10 :
printf("10");
break;
case 100 :
printf("1000");
break;
default :
printf("default");
break;
}
Give the output of the following code :
int main()
{
int i=5;
while(i)
{
printf("Hello world");
}
return 0;
}
Which of the keywords denote the scope of a variable in C :
What are the functions that are available to manipulate strings in C?
Give the output of the following code snippet :
int i=10;
int func(int x)
{
i++;
return ++i;
}
int func2(int y)
{
--i;
return --i;
}
void main()
{
int a=func(i);
int b=func2(i);
printf("%d",a+b);
}
Give the output of the following code snippet :
union student
{
int no;
int no2;
};
void main()
{
union student s;
s.no=1001;
printf("%d",s.no2);
}
Give the output of the following code snippet :
int func()
{
return (double)5.0;
}
void main()
{
printf("%d", func());
}
Which mode is used to denote opening the binary file for update where the writing is done at the end?
Give the output of the following code snippet :
int main()
{
int i=0;
while(!i++)
{
printf("%d",i--+ ++i);
main();
}
}
Give the output of the following code snippet :
void func()
{
int j=20;
printf("%d",j);
}
void func()
{
int i=10;
printf("%d",i);
}
int main()
{
func();
func();
}
Which of the following are not user interfaces that help to debug a program with Visual Studio:
What is the unsigned integral produced by the sizeof operator?
Give the output of the following code snippet :
int func(int x)
{
int y=x++;
return x*y;
}
void main()
{
int a=2;
int b=1;
int c=a*b+func(a)*func(b);
printf("%d",c);
}
Which of the following are the user interfaces that help to debug a program with Visual Studio:
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()
{
FILE *fp1,*fp2;
fp1=fopen("day.text","r");
fp2=fopen("night.txt","r");
fclose(fp1,fp2);
return 0;
}
What is the range of the values allowed for the data type int in C:
The breakpoint pauses the execution
Give the output of the following code snippet :
int main()
{
int i=0;
if(i--)
{
printf("%d",i++);
main();
}
else
printf("%d",--i);
}
In the do-while loop, how many times is the loop executed if the condition is false?
Which keyword can be used for exiting recursion?
Which of the following statements are true about recursion?
Name the three main parts of a for loop in C :
What is a binary stream in C?
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]);
}
Which of the following is a storage specifier?
Which of the following functions are available in the header file string.h in C?
According to the presenter, to overcome the learning curve with Visual Studio, with ease, it’s better to
Give the output of the following code snippet :
void main()
{
int n;
for (n = 4; n!=0; n--)
printf("%d ", n--);
}
In the while loop, how many times is the loop executed if the condition is false?
What are the arguments passed to the fread() function?
Give the output of the following code snippet :
void main()
{
int i = 0;
for (i = 0; i < 5; i++)
if (i < 4)
{
printf("Ho ");
break;
}
}
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 : Assume the contents of the file 'Test.txt' is "Hello World".
void main()
{
FILE *fp,*fp1;
char x[20];
fp = fopen("Test.txt","r");
char i=0;
while(i=fgetc(fp)!=NULL)
{
printf("%c",i);
}
fclose(fp);
}
Boiler plate code is auto-generated in Visual Studio by
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);
}
Which of the keywords denote the size and type of a variable in C :
Give the output of the following code snippet :
void main()
{
int k;
for (k = -3; k < -5; k++)
printf("Hello");
}
Give the output of the following code :
void main()
{
int var = strcmp("Yellow","World");
printf("%d", var);
}
Give the output of the following code :
void fun (int)
{
printf("Hello");
}
void main()
{
fun();
}
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 characters are printed by the ispunct() function defined in ctype.h?
The nth element of an array arr[n] of n values is accessed by:
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);
}
Give the output of the following code snippet :
struct student
{
int no;
};
void main()
{
struct student s;
s.no=1001;
printf("%d",s.no);
}
Which of the keywords denote the scope of a variable in C :
Consider the given example of a function declaration in C. State which of the following is correct.
Which of the following is a two dimensional array in C :
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");
}
Which of the following statements is true about Strings in C :
What is the range of the values allowed for the data type char 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;
}
Among all the files that make up a source program, how many times can an external variable be defined?
Which is the keyword used to create a structure in C?
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 :
struct student
{
char c[10];
};
void main()
{
struct student s;
printf("%d", sizeof(s));
}
Give the output of the following code :
void main()
{
char new1[]= { 0 };
strcpy(new1,"Jello");
int n=strlen(Jello);
printf("%d ",n);
}
Which of the following statements is true with regards to the break statement :
Which mode is used to denote opening the text file for update but discards any previous contents if any?
For a given C program, a function can be called :
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);
}
Give the output of the following code snippet :
void main()
{
Test();
}
void Test()
{
printf("Hello");
}
The rewind(fp) function is equivalent to which of the following functions?
Give the output of the following code :
struct student
{
int no;
char name[20];
};
void main()
{
struct student s;
no = 8;
printf("%d", no);
}
The last element of the array arr[10] is accessed by :
Which of the keywords denote the scope 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 :
void main()
{
int a=13;
if(a==12)
{
a==12?a=0:a=1;
if(a==0)
a++;
else
a--;
}
if(a==13)
a=a-2;
printf("%d",a);
}
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 :
void main()
{
char str[]="HelloWorld";
int z=10*3+5-4;
if(z< 10)
printf("%s",str);
else
printf("%20s",str);
}
Visual Studio has
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,*fp1;
fp=fopen("Test.txt","w+");
fputc('S',fp);
fclose(fp);
fp1=fopen("Test.txt","r");
while((x=getc(fp1))!=EOF)
{
printf("%c",x);
}
fclose(fp1);
}
Which of the following are the user interfaces that help to debug a program with Visual Studio:
Give the output of the following code snippet :
void main()
{
int i=0;
do
{
i=i+3;
printf("%d",i);
}
while(1);
}
Give the output of the following code snippet :
void func(int a,int b)
{
int z=a > b?a=10:a=20*10;
printf("%d ",z);
}
int main()
{
func(100,250);
func(30,20);
}
What is the total length of the string containing n characters in C?