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.
Which of the following statements is not true about the fclose() function?
Give the output of the following code snippet :
void main()
{
static int x;
if (x++ < 2)
{
printf("Ho " );
main();
}
}
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;
}
}
Which of the following are basic types of variables in C :
Which of the following statements is true about the fclose() function?
How many elements can the array arr[10][5] hold?
Platforms and software supported by Visual Studio are,
Versions of Visual Studio are,
Show the correct order of execution for creating and executing a program in Visual Studio:
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 :
int main()
{
int n;
for (n = 5; n!=0; n--)
printf("%d ", n--);
return 0;
}
Which of the following methodologies are used to control the flow of the program in C?
Give the output of the following code snippet :
void main()
{
int i=0;
int sum=0;
do
{
printf("%d",i);
sum+=i;
i++;
}
while(!i);
}
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".
Which of the following is related to a Microsoft Development tool package.
Give the output of the following code snippet :
struct student
{
int no;
};
void main()
{
struct student s;
no=10;
printf("%d",no);
}
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 :
void main()
{
int x;
for(x=1; x< =3; x++);
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 :
int func(int a)
{
int b=10,i=0;
while(a!=0)
{
int c=a+b;
a--;
b--;
printf("%d ",c);
break;
}
return 0;
}
int main()
{
int x=5;
func(x);
}
Give the output of the following code snippet :
int main()
{
float a,b;
int func(int,float);
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()
{
int a=13,b=20;
if(!a==!b)
printf("%d",++a);
else
printf("%d",--b);
}
Which of the following are true about variables in C:
Which of the following functions is used to rename a particular file?
Which is the keyword used to create a structure in C?
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);
}
External static declaration can be applied to functions as well. State true or false :
Versions of Visual Studio are,
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);
}
Name the header file used to call the printf function in the main program.
Give the output of the following code snippet :
void main()
{
char x=10;
do
{
x+=10;
printf("%d ",x);
}
while(x!=20);
}
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;
}
A new C program can be executed without being compiled . True or False?
In C, which of the following are the possible scope of a variable?
Which of the keywords denote the size and type of a variable in C :
Which of the following are keywords in C:
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 steps are required to execute a C program in Visual Studio?
Which of the following is an example of looping 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 Point
{
int x;
int y;
};
int main()
{
struct Point p1 = {10};
struct Point p2 = p1;
printf("%d %d", p2.x, p2.y);
getchar();
}
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 :
void main()
{
int a=13;
if(a==12)
a==12?a=0:a=1;
else
a--;
printf("%d",a);
}
Give the output of the following code snippet :
void main()
{
for (int i=0; i < 2; i++)
{
for (int j = 0; j < 2; j++)
{
printf("1 ");
}
printf("2 ");
break;
}
printf("Out of loop");
}
Name the three main parts of a for loop in C :
Which is the function used to length of a string in C?
What does the fread() function return?
Free Edition of Visual Studio is,
What is a binary stream in C?
What is the green play button in the Visual studio does?
Give the output of the following code snippet :
register int x;
void main()
{
printf("%d", x);
}
What is integrated into Visual Studio?
How can an array of strings be represented as?
Give the output of the following code snippet :
int main()
{
int i;
for(i=0; i< =6; i=1+2)
{
if(i < 3)
{
printf("Test1 ");
continue;
}
else
{
printf("Test2");
break;
}
}
return 0;
}
The steps to start a New Wizard in Visual Studio 2010 is,
Give the output of the following code :
void main()
{
char new1[]= { 0 };
strcpy(new1,"Jello");
int n=strlen(Jello);
printf("%d ",n);
}
Give the output of the following code snippet :
void main()
{
int a=12;
--a;
if(a)
{
}
printf("%d",a);
}
Which of the following is not a logical operator in C ?
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 :
struct point
{
int x;
int y;
};
struct point2
{
int x;
int y;
};
void fun(struct point);
int main()
{
struct point2 p1 = {1, 2};
fun(p1);
}
void fun(struct point p)
{
printf("%d\n", p.x);
}
Give the output of the following code snippet :
int main()
{
int i=0;
if(i--)
{
printf("%d",i++);
}
else
printf("%d",--i);
main();
}
Which of the following are keywords in C:
Give the output of the following code snippet :
void main()
{
int i = 2;
do
{
printf("Hi ");
}
while (i < 2)
}
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++);
printf("%d ",a);
}
}
What is the method used to pause an application at a particular point ?
Give the output of the following code :
void main()
{
int var = strcmp("Worlc","World");
printf("%d", var);
}
Give the output of the following code snippet :
void main()
{
int i=0,j;
for(i=-1,j=2; j< 5; j++)
{
if(j!=5)
continue;
else i++;
}
printf("%d",i);
}
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 :
struct student
{
int no;
}
void main()
{
struct student s;
s.no=10;
printf("%d",no);
}
Wizard in Visual studio is normally a set of,
Which of the following statements is true about the fopen function?
Give the output of the following code snippet :
void func(int a)
{
int sum=0,x;
while(a!=0)
{
x=a%100;
sum+=(x+x+x);
a=a/10;
}
printf("%d ",sum);
}
int main()
{
func(1000);
func(2222);
}
Among all the files that make up a source program, how many times can an external variable be defined?
Visual Studio is NOT
The breakpoint pauses the execution
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);
}
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 func()
{
int i=10;
if(i!=0)
return 10;
else
return 20;
}
int main()
{
int a=func();
printf("%d",a);
}
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;
printf("%d %d",sizeof(p1),sizeof(p2));
}
Give the output of the following code snippet :
void main( )
{
float c;
c = getchar( );
printf( "\nYou entered: ");
putchar( c );
}
Assume input as 2.45 :
Versions of Visual Studio are,
How many arguments are passed to the strcmp function for string manipulation in C?
Find the output of the following program :
int main()
{
char str[] = "Hello\0\World";
printf("%s\n", str);
return 0;
}
Which of the following statements is true about Strings in C :
Give the output of the following code snippet :
void func()
{
int i=10;
void func1()
{
int j=10;
printf("%d",j);
}
func1();
printf("%d",i);
}
int main()
{
func();
}
The main function in a given program cannot be called recursively. State true or false :
Give the output of the following code snippet :
void main()
{
int a=10;
--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;
}
}
Which of the following are constituents of a C program :
Give the output of the following code snippet :
int main()
{
int a = 0, i = 0;
for (i = 0; i < 5; i++)
{
continue;
a++;
}
printf("%d",a);
}
Which is NOT a Visual Studio edition.
In which header file is the EOF character defined in C?
Which of the following are parts of a function in C:
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);
}
}
For a given C program, a function can be called :
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;
}
}
Visual Studio is NOT
Which of the following parts of a function are required when calling a function:
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 :
struct student
{
int id;
};
void main()
{
struct student s[10];
s.id[0] = 10;
printf("%d", s.id[0]);
}
Give the output of the following code snippet :
void main()
{
struct employee
{
int id;
};
struct employee emp1= {20};
printf("%d\t",emp1.id);
}
Property of external variable to be accessed by any source file is called as
Which of the following statements is true :
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);
}
Which of the following is used to represent comments in C:
Which of the following operators performs the same function of the logical AND operator?
The steps to start a New Wizard in Visual Studio 2010 is,
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;
}
}
What is the number of values allowed for the character data type in 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:
struct p
{
char c;
float f;
};
int main()
{
struct p x = {1,97,3};
printf("%f \n", x.f);
}
Give the output of the following code snippet :
int main()
{
struct student
{
char name[25];
int age;
};
struct student e;
strcpy(e.name,"Jenn");
e.age = 25;
printf("%s %d\n", e.name, e.age);
return 0;
}
In which of the following ways can a structure variable be created?
In which header file is the integer expression errno declared?
Which of the following is NOT related to a Microsoft Development tool package?
Which of the following can be called between a read and a write operation in a file?
Give the output of the following code snippet :
void demo();
int main()
{
demo();
return 0;
}
void demo()
{
printf("Hello ");
}
Visual Studio is NOT
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 keywords denote the scope of a variable in C :
What is the value of the argument given to the character testing functions defined in ctype.h?
Give the output of the following code snippet :
void main()
{
int a;
for(a=0; a< 5; a++)
{
if(a==2)
break;
printf("Hello world");
}
}
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);
}
Which of the keywords denote the scope 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 :
void main()
{
int a=12,i=0;
--a;
i++;
do
{
printf("%d",a);
++i;
}
while(--i);
}
Give the output of the following code :
int main()
{
int i=1;
if(!i)
printf("Hello,");
else
{
i=0;
printf("Jello");
main();
}
return 0;
}
Give the output of the following code snippet :
void main()
{
int x=0,y=1,z=2;
for(;;)
printf("%d",x+y+z);
}
The last element of the array arr[10] is accessed by :
What is the range of the values allowed for the data type unsigned char in C:
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);
}
}
The keyword 'break' cannot be used within :
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);
}
Which of the following statements is true about the remove() function?
Which of the following statements is true by the Call by value method?
Give the output of the following code snippet : Assume the input as 100
void main()
{
int x=0,z;
z=printf("%d ",scanf("%d ",&x));
printf("%2d",z);
}
Which mode is used to denote opening the binary file for update where the writing is done at the end?
Which of the following is a ways can be used to represent an array of Strings in C?
Which is the function used to copy a particular string into an array in C?
What are the two ways in which the arguments can be passed to a function?
Which of the following are not features of Debugging with Visual Studio :
Which of the following are the user interfaces that help to debug a program with Visual Studio:
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()
{
char new1[]="Hi";
for(int i=0; i< 3; i++)
{
printf("%d ",new1[i]);
}
}
Give the output of the following code snippet :
int func2()
{
int j=100;
return ++j;
}
void func()
{
int i=10;
int j=func2();
printf("%d",i+j);
}
int main()
{
func();
}
Following is a challenge with Visual studio for a beginner,
Give the output of the following code snippet :
void func()
{
int i=1;
while(!i)
{
func();
}
printf("%d",i++);
}
void main()
{
func();
}
How many arguments does the fclose() function take?
Identify the general syntax of the conditional operator in C :
Development tools are normally NOT used for,
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 i=0;
for(;; i++)
{
i=i+3;
if(i==12)
continue;
else
break;
}
printf("%d",i);
}
Give the output of the following code snippet :
struct p
{
int k;
char c;
};
int main()
{
struct p x = {10,1};
x.k=5;
printf("%d %d\n", x.k,x.c);
}
Give the output of the following code snippet :
int func()
{
int i=10;
if(i!=0)
return 10.50;
else
return 20.75;
}
int main()
{
float a=func();
printf("%.2f",a);
}
What are the arguments passed to the fwrite() function?
Give the output of the following code snippet :
int func(int a,int b)
{
int z=a >= b?return ((a= a/b): (a=20%10)) ;
}
int main()
{
int a,b;
a=func(100,250);
b=func(20,20);
printf("%d %d",a,b);
}
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;
}
Development tools are normally NOT used for,
Give the output of the following code snippet :
struct point
{
int x;
int y;
};
struct point2
{
int x;
int y;
};
int main()
{
struct point p = {1};
struct point2 p1 = p;
printf("%d\n", p1.x);
}
Which of the following characters are printed by the ispunct() function defined in ctype.h?
Give the output of the following code snippet :
void func(int a)
{
int sum=0,x;
while(a!=0)
{
x=a%10;
sum+=(x*x);
a=a/10;
}
printf("%d ",sum);
}
int main()
{
func(100);
func(200);
}
Platforms and software supported by Visual Studio are,
Give the output of the following code snippet :
void main()
{
int i=0;
do
{
printf("%d",i);
i++;
}
while(i);
}
How many arguments does the getchar() function take?
Which is the header file used to help manipulate strings in C?
Which of the following is the default method to pass arguments in C?
Which of the following is an example of loop in C?
In C, a function can be called from :
What is Visual Studio?
Which of the following gives the memory address of the first element in array arr, an array with 10 elements?
What are the two arguments that are passed to the strcpy function for string manipulation in C?
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");
}
Which of the keywords denote the scope of a variable in C :
Give the output of the following code :
void fun (int)
{
printf("Hello");
}
void main()
{
fun();
}
Which of the following functions is used to set the file position for the stream?
Which keyword can be used for exiting recursion?
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);
}
Give the output of the following code snippet :
void Test();
void main()
{
int k = Test();
printf("%d", k);
}
void Test()
{
printf("Hello ");
}
Which mode is used to denote opening the text file for update but discards any previous contents if any?
Give the output of the following code snippet :
struct p
{
int mark1,mark2;
};
int main()
{
struct p x = {50,50,50};
printf("%d %d\n",x.mark1,x.mark2);
}
Debugging allows you to :
Give the output of the following code snippet :
struct
{
int no;
}
void main()
{
struct s;
s.no=10;
printf("%d",no);
}
Development tools are normally NOT used for,
Which of the following statements is true about an escape sequence in C?
Visual studio supports
Give the output of the following code snippet :
int main()
{
int i;
for (i = 1; i !=6; i += 2)
printf("Ho ");
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=10;
x[0].c='B';
printf("%d %c\n", x[1].k,x[1].c);
}
Give the output of the following code snippet :
int main()
{
for(int i=0; i< =4; i++)
{
printf("%d ",i);
}
return 0;
}
Which of the following statements is true about UNICODE?
Give the output of the following code snippet :
void main()
{
static double x;
int x;
printf("x is %d", x);
}
Give the output of the following code snippet :
void main()
{
int i;
for(i=0; i< =4; i++)
{
printf("%d",i);
break;
printf(" Test1");
}
printf(" Test2");
}
Give the output of the following code snippet :
void main()
{
int i=0;
do
{
i=i+3;
i++;
printf("%d",i);
}
while();
}
Visual Studio has
Which of the keywords denote the size and type of a variable in C :
Which mode is used to denote opening the binary file for writing, where the writing is done at the end?
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 :
void main()
{
char new1 ='c';
if(( new1 =='C') || (new1 =='c'))
printf("Same");
else
printf("Not Same");
}
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?
Give the output of the following code snippet :
int func(int a)
{
int b=0,i=0;
a=b;
while(a!=0)
{
a--;
b--;
func(b);
}
printf("%d %d",a,b);
return 0;
}
int main()
{
int x=5;
func(x);
}
Give the output of the following code :
void main()
{
int var = strcmp("Hello","World");
printf("%d", var);
}
Automatic variables are variables that are
What is the return type of the character testing functions defined in ctype.h?
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);
}
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);
}
Give the output of the following code snippet :
union student
{
int no;
float no1;
double no2;
};
void main()
{
union student s;
s.no=1001;
printf("%d",sizeof(s));
}
The arguments to a function in C are enclosed within
Visual studio supports
Give the output of the following code snippet :
void main()
{
int a=1;
if(!a)
printf("Value is not 1");
else
printf("Value is 1");
}
How many arguments are passed to the strcpy function for string manipulation 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 x=0,z;
float p=2.4567;
float q=5.6543;
float r=0.0;
printf("%.2f",p+q-r);
}
What does the fclose() function take as the argument?
What is the unsigned integral produced by the sizeof operator?
Consider the given code snippet in C. In which functions can the variable b1 be accessed?
void hello();
int a1=10;
void main()
{
printf("%d",a1);
hello();
}
int b1=12;
void hello()
{
printf("%d",b1);
}
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);
}
}
Platforms and software supported by Visual Studio are,
Which of the following are constituents of a C program :
Which mode is used to denote opening the text file for update?
In the while loop, how many times is the loop executed if the condition is false?
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?
Which is the function used to concatenate two strings in C?
Give the output of the following code snippet :
void main()
{
char arr[11]="The African";
printf("%s",arr);
}
Identify the type of error in the given code :
void main()
{
printf("Hello world");
printf(Test);
}
Which of the following is a valid string definition?
What are the types of functions that can be used in C?
Give the output of the following code snippet :
void main()
{
printf("Welcome");
goto L2 ;
L1:
printf("Loop 1");
L2:
printf("Loop2");
goto L1;
}
Which of the following modes is the temporary file opened in?
Give the output of the following code snippet :
void main()
{
int a=50;
if(a>10)
printf("First");
else if(a>20)
printf("Second");
else if(a>30)
printf("Third");
}
Which is the function key in VS is associated with stepping out of the function while debugging?
Which of the following is a valid syntax for the function freopen()?
Boiler Plate code is auto-generated in Visual Studio by,
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 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 i = 0;
do
{
i++;
printf("Ho ");
}
while (i < 3);
}
The default statement in a switch case statement is optional and can be skipped. State true or false:
Versions of Visual Studio are,
Give the output of the following code snippet :
void main()
{
struct employee
{
int id=10;
};
struct employee emp1= {20};
printf("%d\t",emp1.id);
}
Give the output of the following code snippet :
int main()
{
int i,j,k;
for(i=0,j=2,k=1; i< =4; i++)
{
printf("%d ",i+j+k);
}
return 0;
}
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 syntax for an if-else/if-else if statement :
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,b=20;
if(!a!=b)
printf("%d",++a);
else
printf("%d",--b);
}
Give the output of the following code snippet :
int main()
{
int i;
for (i = 1; i != 5; i += 2)
printf("Ho ");
return 0;
}
Give the output of the following code snippet :
void main()
{
int i=0;
int sum=0;
do
{
printf("%d",i);
sum+=i;
}
while(i=1);
}
Consider the given example of a function declaration in C. State which of the following is valid.
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);
}
Visual Studio has
Which mode is used to denote opening the binary file for update but discards any previous contents if any?
What is the return-type of the function sqrt() in C?
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);
printf("%d",EOF);
fclose(fp);
}
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 :
int main()
{
int i;
int arr[3] = {0};
for (i = 0; i < = 3; i++)
printf("%d ", arr[i]);
return 0;
}
Which of the following are file positioning functions in C?
Which of the following is a valid initialization of a multidimensional array?
Give the output of the following code snippet :
int main()
{
int i=0;
for(i=0; i< 5; i++)
{
if(i==3)
return 0;
printf("Ho");
}
printf("Hello world");
}