Knowledge check.
- Choose one best answer from given 4 choices for each questions.
- Review before submitting, as you won't get a chance to review after submitting.
- 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 true about Strings in C :
Name the type of errors that occur due to a missing semi-colon(;) in a C program:
Platforms and software supported by Visual Studio are,
If the return type of a function is not mentioned, what is its default return type?
Give the output of the following code snippet :
void main()
{
int a=12,i=0;
--a;
while(++i)
{
printf("%d",a);
++i;
}
}
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);
}
Which of the following is a valid string definition?
Give the output of the following code snippet :
int main()
{
int i;
for (i = 1; i !=6; i += 2)
printf("Ho ");
return 0;
}
Which library function in C is used to print a single character every time it is called?
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;
for(i=0; i< =6; i=1+2)
{
if(i < 3)
{
continue;
printf("Test1 ");
}
else
{
break;
printf("Test2");
}
}
}
Which among the following is the correct syntax to declare a variable as static and register?
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 :
void main()
{
int a=10;
a--;
switch(a)
{
case 10 :
printf("%d",a);
break;
case 9 :
printf("%d",a++);
break;
printf("%d",a);
}
}
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);
}
Which of the following are examples of built in functions?
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;
}
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);
}
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);
}
}
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);
}
Give the syntax for an if-else/if-else if statement :
What is the general syntax of a function which is declared in C?
Give the output of the following code snippet :
int main()
{
int i = 0;
do
{
i++;
if (i == 2)
continue;
printf("In the loop ");
}
while (i < 2);
printf("%d\n", i);
}
Which of the following is a two dimensional array in C :
Which of the following statements is true about structures 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);
}
Which of the following is a valid array declaration in C ?
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);
}
Which keyword in C does not change the number of iterations which could have been executed by the condition?
Which of the following statements is an example of an array initialization in C?
Which of the following statements are used to alter the flow of control in a C program :
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);
}
Give the output of the following code snippet :
int main()
{
int i=0;
if(i--)
{
printf("%d",i++);
}
else
printf("%d",--i);
main();
}
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 :
void main()
{
int x=0,y=1,z=2;
if((x==y)&(z==x+2))
printf("%d",z);
else
printf("%d",++x);
}
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);
}
Which of the following statements is not true with regards to the continue statement :
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);
}
Which of the following are keywords 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);
}
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 fopen function?
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 is a text stream in C?
Which of the following parts of a function are required when calling a function:
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?
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 countFun ( int count )
{
if ( count < = 5 )
{
printf(" %d ", count);
countFun( count + 1 );
}
}
int main()
{
countFun ( 2 );
}
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 is the function key in VS is associated with stepping out of the function while debugging?
Give the output of the following code snippet :
int main()
{
int n;
for (n = 5; n!=0; n--)
printf("%d ", n--);
return 0;
}
A function cannot have more than one return statement. State true or false :
Which of the following statements indicate the general nature of computer programs?
Which of the following statements is true with regards to the break statement :
Which is the function used to copy a particular string into an array in C?
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 are the user interfaces that help to debug a program with Visual Studio:
What is Visual Studio?
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);
}
How many times is the initialization part of the for loop carried out?
Which of the following is related to a Microsoft Development tool package?
Give the output of the following code snippet :
void main()
{
int n;
for (n = 4; n!=0; n--)
printf("%d ", n--);
}
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();
}
Identify the general syntax of the conditional operator in C :
Which of the following is related to a Microsoft Development tool package.
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 snippet :
struct student
{
int no = 5;
char name[20];
};
void main()
{
struct student s;
s.no = 8;
printf("Hello");
}
Which of the following is not a debugger :
Which of the following statements is true about a minimal function in C?
Visual studio supports
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 :
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 of the following functions are available in the header file string.h in C?
Which of the following statements is true about Strings 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;
}
Which of the keywords denote the size and type of a variable in C :
What is the range of the values allowed for the data type int in C:
Which of the following operators performs the same function of the logical OR operator?
Give the output of the following code snippet :
void main()
{
char x=10;
do
{
printf("%d ",x++);
}
while(x< 200);
}
What does the fread() function return?
Give the output of the following code snippet :
void func()
{
int i=1;
while(!i)
{
func();
exit(0);
}
printf("%d",i++);
}
void main()
{
func();
}
Give the output of the following code snippet :
void Test();
void main()
{
int k = Test();
printf("%d", k);
}
void Test()
{
printf("Hello ");
}
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 gives the memory address of the first element in array arr, an array with 10 elements?
Give the output of the following code snippet :
void main()
{
int i=3,x=10;
i=i*x/i;
switch(i)
{
case 2:
printf("%d ",x++);
break;
case 3:
printf("%d ",x+2);
break;
case 4:
printf("%d ",x+3);
default:
printf("Hello");
break;
}
}
Give the output of the following code snippet :
int sub(int a, int b)
{
if(a>b)
return a-b;
else
return b-a;
}
int main()
{
printf("%d", sub(10,20));
}
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;
s.no=10;
printf("%d",no);
}
Which of the following methodologies are used to control the flow of the program in C?
Which of the following is a debugger :
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 ");
}
In the while loop, how many times is the loop executed if the condition is false?
Give the output of the following code snippet :
void main()
{
int a = 10, b, c;
if(a >= 50)
b = 20;
c = 30;
printf("%d, %d, %d\n", a, b, c);
}
Give the output of the following code snippet :
void main()
{
printf("Welcome");
goto L2 ;
L1:
printf("Loop 1");
L2:
printf("Loop2");
goto L1;
}
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;
}
The conditional operator can be used to replace which condition statement in C?
Which of the following is NOT related to a Microsoft Development tool package?
The arguments to a function in C are enclosed within
In which of the following ways can a structure variable be created?
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);
}
}
Which of the following statements is true about a file in C?
Give the output of the following code :
void main()
{
char new1[]= { 0 };
strcpy(new1,"Jello");
int n=strlen(new1);
printf("Length : %d ",n);
}
Name the looping statements available in C :
Find the output of the code snippet :
void main()
{
int arr[10]= {10,2.5,3,5.5};
for(int i=0; i< 5; i++)
printf("%d ",arr[i]);
}
Debugging allows you to :
Which of the following are not user interfaces that help to debug a program with Visual Studio:
Among all the files that make up a source program, how many times can an external variable be defined?
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 :
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 :
What are the functions that are available to manipulate strings in C?
The steps to start a New Wizard in Visual Studio 2010 is,
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);
}
Wizard in Visual studio is normally a set of,
How many arguments does the fclose() function take?
Which of the following statements is true about Strings in C :
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;
}
Give the output of the following code snippet :
struct student
{
int id;
};
void main()
{
struct student s[10];
s.id = 10;
printf("%d", s.id);
}
Which is the function used to concatenate two strings in C?
Visual Studio is NOT
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 size and type of a variable in C :
Which of the following functions is used to set the file position for the stream?
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[0].k,x[0].c);
}
Which of the following are not user interfaces that help to debug a program with Visual Studio:
What is the escape sequence used to denote a tab space in C?
Give the output of the following code snippet :
struct p
{
int k;
char c;
float f;
};
int p = 10;
int main()
{
struct p x = {1,97};
printf("%c %d\n", x.c, p);
}
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,t1.p.c);
}
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);
}
The default statement in a switch case statement is optional and can be skipped. State true or false:
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];
}
Give the output of the following code snippet :
void main()
{
Test();
void Test()
{
printf("Hello");
}
}
Give the output of the following code snippet :
void Test1();
void main()
{
void Test1()
{
printf("Hello ");
}
}
Give the output of the following code snippet :
void main()
{
char new1 ='c';
if(( new1 =='C') || (new1 =='c'))
printf("Same");
else
printf("Not Same");
}
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);
}
Name some of the basic errors that may occur during compilation of a C program :
Give the output of the following code snippet :
int main()
{
int i;
for(i=1; i< =3; i++)
{
printf("Ho ");
}
printf("%d",i);
return 0;
}
When a program begins execution, which of the following streams are open?
Some of the ways in which looping can be carried out in C is :
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=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 output of the given code if the file 'Test.txt' is not present?
void main()
{
char x;
FILE *fp;
fp=fopen("Test.txt","r");
while((x=getc(fp))!=EOF)
printf("%c",x);
printf("\n");
fclose(fp);
}
Which of the following statements is true about an escape sequence in C?
How many elements can the array arr[10][5] hold?
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 statements is true about the setvbuf() function?
What is Visual Studio?
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 k;
for (k = -3; k < -5; k++)
printf("Hello");
}
Write the given if else statements using conditional operator in C :
if (x < y)
{
min = x;
}
else
{
min = y;
}
Which is NOT a Visual Studio edition.
Which of the following are file positioning functions in C?
Give the output of the following code :
struct student
{
int no;
char name[20];
};
void main()
{
struct student s;
no = 8;
printf("%d", no);
}
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);
}
Give the output of the following code snippet :
int func2()
{
int j=100;
return ++j;
}
void func()
{
int i=10;
int j=func2();
if(i< =0)
printf("%d",i+j);
}
int main()
{
func();
}
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);
}
}
Which of the following statements is true about the remove() function?
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");
}
Breakpoints do not allow you to :
Which of the following are file positioning functions in C?
Which of the following is 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 :
struct p
{
int k;
char c;
};
int main()
{
struct p x = {10,1};
x.k=5;
printf("%d %d\n", x.k,x.c);
}
A new C program can be executed without being compiled . True or False?
Which of the keywords denote the size and type of a variable in C :
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 :
void main()
{
int i=0,j;
for(i=1,j=2;;)
{
i=i+2;
if(i%j==0)
continue;
else
break;
}
printf("%d",i);
}
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));
}
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);
}
Name the feature used in Visual Studio to help debugging.
Which is the keyword used to create a structure in C?
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 :
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 i = 0;
while (++i)
{
printf("Ho");
}
}
What is Visual Studio?
Which of the following modes is used to indicate full buffering in the setvbuf() function?
Which keyword can be used for exiting recursion?
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 are the user interfaces that help to debug a program with Visual Studio:
Give the output of the following code snippet :
int main()
{
int i=0;
while(!i++)
{
printf("%d",i--+ ++i);
main();
}
}
What does the fclose() function take as the argument?
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);
}
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;
}
}
Name the three main parts of a for loop in C :
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 :
int x;
void main()
{
printf("%d", x);
}
Give the output of the following program :
int fun(int i)
{
i++;
return i;
}
int main()
{
int fun(int);
int i=3;
fun(i=fun(fun(i)));
printf("%d\n", i);
return 0;
}
Which of the following is a valid syntax for the sscanf() function?
Which of the following statements is not true about the tmpfile() function?
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;
}
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);
}
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;
}
}
Which of the following is an example of loop in C?
Which of the following are constituents of a C program :
Give the output of the following code :
void fun (int)
{
printf("Hello");
}
void main()
{
fun();
}
Which of the keywords denote the scope of a variable in C :
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");
}
Name the looping statements available in C :
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");
}
Which of the following functions are equivalent to the printf() function?
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);
}
Give the output of the following code snippet :
void main()
{
Test();
}
void Test()
{
printf("Hello");
}
Give the output of the following code snippet :
void main()
{
static int x = 3;
x++;
if (x < = 5)
{
printf("Hello ");
main();
}
}
Default storage class, if not any is specified for a local variable, is auto
Visual Studio is NOT
A stream is connected to a file or device by :
What are the two arguments that are passed to the strcpy function for string manipulation in C?
Give the output of the following code snippet :
void main()
{
printf("Before continue ");
continue;
printf("After continue\n");
}
Which of the keywords denote the scope of a variable in C :
Which of the following is a valid syntax for the function freopen()?
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);
}
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;
}
Which of the keywords denote the size and type of a variable in C :
Name the looping statements available in C :
Which of the following statements is true about the EOF character in C?
Which of the following statements is true about the fclose() function?
Which of the following are keywords in C:
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 i = 2;
do
{
printf("Hi ");
}
while (i < 2)
}
What are the types of functions that can be used in C?
What is the return type of the character testing functions defined in ctype.h?
Give the output of the following code snippet :
void main( )
{
int c;
c = getchar( );
printf( "\nYou entered: ");
putchar( c );
}
Assume input as 6 :
Which of the following characters are printed by the ispunct() function defined in ctype.h?
Which of the following is related to a Microsoft Development tool package?
Which of the following is an example of loop in C?
Give the output of the following code snippet :
void main()
{
char x;
FILE *fp;
fp=fopen("Test.txt","r");
if(fp==NULL)
{
printf("Fail");
exit(0);
}
else
printf("Available");
fclose(fp);
}
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()
{
char new1 ='c';
if( new1 =='C')
printf("Same");
else
printf("Not Same");
}
Give the output of the following code snippet :
int main()
{
int i;
for (i = 1; i != 5; i += 2)
printf("Ho ");
return 0;
}
External static declaration can be applied to functions as well. State true or false :
What is the unsigned integral produced by the sizeof operator?
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:
struct p
{
char c;
float f;
};
int main()
{
struct p x = {1,97,3};
printf("%f \n", x.f);
}
Which of the following statements is true about the break statement in C:
Which function prints an error message corresponding to integer in errno ?
Which of the following are constituents of a C program :
Which of the following is used to represent comments in C:
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);
}
Which of the following statements is true about a minimal function 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;
}
For a 32 bit float number with 6 significant bits, the magnitude lies between :
Which of the following are constituents of a C program :
Automatic variables are variables that are
Consider the given code snippet in C. What is the output of the program :
void main()
{
char a=2345;
printf("%c",a);
}
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 :
int main()
{
register static int i = 10;
i = 11;
printf("%d\n", i);
}
Platforms and software supported by Visual Studio are,
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 :
void func(a,b)
int a,int b;
{
int i=10;
if(i< =0)
printf("%d",a+b);
}
int main()
{
func(100,200);
}
Give the output of the following code snippet :
void main()
{
static double x;
int x;
printf("x is %d", x);
}
Which of the keywords denote the size and type of a variable in C :
Give the output of the following code :
int main()
{
char str1[] = "Hello";
char str2[] = "Hello";
if(str1 == str2)
printf("Equal\n");
else
printf("Unequal\n");
return 0;
}
In which header file is the integer expression errno declared?