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.
Give the output of the following code snippet :
void main( )
{
char c;
c = getchar( );
printf( "\nYou entered: ");
putchar( c );
}
Assume input as '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 related to a Microsoft Development tool package.
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 keywords denote the size and type of a variable in C :
Which of the following statements are used to alter the flow of control in a C program :
Visual Studio is NOT
Which is the function used to length of a string in C?
Which of the following functions are available in the header file string.h in C?
The nth element of an array arr[n] of n values is accessed by:
Which of the following is a valid syntax for the sscanf() function?
If the return type of a function is not mentioned, what is its default return type?
Platforms and software supported by Visual Studio are,
Which of the following statements is true about the setvbuf() function?
Which is the header file used to help manipulate strings in C?
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 functions are equivalent to the printf() function?
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);
}
Free Edition of Visual Studio is,
Which of the following are examples of built in functions?
The steps to start a New Wizard in Visual Studio 2010 is,
Which of the following are constituents of a C program :
Give the output of the following C code:
void hello()
{
printf("Welcome");
}
void main()
{
hello();
printf("I repeat");
hello();
}
Give the output of the following code snippet :
int i=10;
int func(int x)
{
i++;
return ++i;
}
int func2(int y)
{
i=30;
--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 :
void main( )
{
printf("Hello,
World ");
}
Give the output of the following code :
void fun (int)
{
printf("Hello");
}
void main()
{
fun();
}
Which of the keywords denote the size and type of a variable in C :
How many arguments does the function fopen() take?
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);
}
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 function returns a non-zero value if the EOF indicator is set for file stream?
Which of the following are keywords in C:
What are the arguments passed to the fread() function?
How many arguments does the fclose() function take?
Which of the following is an example of looping in C?
What is the green play button in the Visual studio does?
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()
{
while(0)
{
printf("Hello world");
}
return 0;
}
Which of the following operators performs the same function of the logical NOT operator?
Which of the following are not features of Debugging with Visual Studio :
The breakpoint pauses the execution
Which of the keywords denote the size and type of a variable in C :
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;
}
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; i< 5; i++);
}
Which mode is used to denote opening the text file for update?
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--);
}
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();
}
What does the fread() function return?
Give the output of the following code snippet :
void main()
{
printf("Welcome");
goto L2 ;
L1:
printf("Loop 1");
L2:
printf("Loop2");
goto L1;
}
When it comes to programming, the debugger is as helpful as the :
Which is the function used to concatenate two strings in C?
Which of the following are not user interfaces that help to debug a program with Visual Studio:
Give the output of the following code snippet :
int main()
{
register static int i = 10;
i = 11;
printf("%d\n", i);
}
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;
}
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[]="Welcome";
printf (new1);
}
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);
}
Among all the files that make up a source program, how many times can an external variable be defined?
Which of the keywords denote the size and type of a variable in C :
Write the given if else statements using conditional operator in C :
if (x < y)
{
min = x;
}
else
{
min = y;
}
Platforms and software supported by Visual Studio are,
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 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,j;
for(i=-1,j=2; j< 5; j++)
{
if(j!=5)
continue;
else i++;
}
printf("%d",i);
}
Give the syntax for the while loop to repeat the action while the condition is true in C :
Give the output of the following code snippet :
int func(int a,int b)
{
int z=a >= b?return (a= a/b): return (a=20%10) ;
}
int main()
{
int a,b;
a=func(100,250);
b=func(20,20);
printf("%d %d",a,b);
}
Which of the following functions is used to set the file position for the stream?
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 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;
}
}
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 the setvbuf() function?
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 keywords denote the size and type of a variable in C :
Which of the following statements is true by the Call by value method?
Give the output of the following code snippet :
void main()
{
struct employee
{
int id;
};
struct employee emp1= {20};
printf("%d\t",emp1.id);
}
Which is the function key in VS is associated with stepping out of the function while debugging?
What is the return-type of the function sqrt() in C?
Which of the following is NOT related to a Microsoft Development tool package?
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 :
Which of the keywords denote the scope of a variable in C :
Give the output of the following code snippet :
int main()
{
while(1)
{
printf("Hello world");
}
return 0;
}
Which mode is used to denote opening the binary file for writing but discards any previous contents if any?
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;
}
Give the output of the following code snippet :
struct student
{
int id;
};
void main()
{
struct student s[10];
s[0].id = 10;
printf("%d", s[0].id);
}
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 main()
{
int n;
for (n = 4; n!=0; n--)
printf("%d ", n--);
}
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()
{
char new1[]= { 0 };
strcpy(new1,"Jello");
char new2[]= { 0 };
strcpy(new2,"Yellow");
char new3[]= { 0 };
strcat(new3,new1);
strcat(new3,new2);
printf (new3);
}
According to the presenter, to overcome the learning curve with Visual Studio, with ease, it’s better to
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 main()
{
int a;
for(a=0; a< 5; a++)
{
if(a< 3)
continue;
else
printf("Hello world");
}
}
What is a binary stream in C?
Which of the following statements are used to alter the flow of control in a C program :
Which of the following are parts of a function in C:
Which of the following is related to a Microsoft Development tool package?
What are the functions that are available to manipulate strings in C?
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 main()
{
int i=0;
do
{
i=i+3;
printf("%d",i);
}
while(1);
}
Which of the keywords denote the size and type of a variable in C :
Which of the following statements is true about Strings in C :
Which is the function used to copy a particular string into an array in C?
Following is a challenge with Visual studio for a beginner,
Which of the following are the user interfaces that help to debug a program with Visual Studio:
Which of the following statements is true about the break statement in C:
Give the output of the following code snippet :
int main()
{
int i = 0;
do
{
i++;
printf("Ho ");
}
while (i < 3);
}
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);
}
Give the output of the following C code:
void main()
{
int a=10,b=2;
int t1=mult(a,b);
int t2=mult(3,30);
printf("Sum = %d", t1+t2);
}
int mult(int a, int b)
{
return a*b;
}
Which of the following is not a debugger :
Which of the following statements is true about the fclose() function?
Visual Studio is NOT
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 ");
}
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 :
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 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 :
void main()
{
int x = 3;
x++;
if (x < = 5)
{
printf("Hello ");
main();
}
}
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);
}
Which of the following is related to a Microsoft Development tool package?
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 :
struct Point
{
int x;
int y;
};
int main()
{
struct Point p1 = {10, 20};
struct Point p2 = p1;
printf("%d %d", p2.x, p2.y);
getchar();
}
Which of the following is a storage specifier?
What is the range of the values allowed for the data type int in C:
Which of the following statements are true about recursion?
Give the output of the following code snippet :
void main()
{
char new1[6]="Welcome";
printf (new1);
}
Give the output of the following code snippet :
void main()
{
int i=0;
do
{
i=i+3;
i++;
printf("%d",i);
}
while();
}
Give the output of the following code snippet :
struct student
{
int id;
};
void main()
{
struct student s[10];
s.[0].id = 10;
printf("%d", s.[0].id);
}
Give the output of the following code snippet :
void func()
{
int i=1;
while(!i)
{
func();
}
printf("%d",i++);
}
void main()
{
func();
}
Give the output of the following code snippet :
void main()
{
int x = 3;
{
x = 4;
printf("%d ", x);
}
printf("%d", x);
}
Visual studio supports
Give the output of the following code snippet :
int func()
{
return (double)5.0;
}
void main()
{
printf("%d", func());
}
Name the type of errors that occur due to a missing semi-colon(;) in a C program:
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?
The conditional operator can be used to replace which condition statement in C?
Which of the following parts of a function are required when calling a function:
Which of the following is a valid structure initialization?
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);
}
Give the output of the following code snippet :
int main()
{
void Fun();
printf("1 ");
Fun();
}
void Fun()
{
printf("2 ");
}
Which of the following statements is true about a file in C?
Which function returns a non-zero value if the error indicator is set for file stream?
Give the output of the following code snippet :
void main()
{
int x=0,y=1,z=2;
for(;;)
printf("%d",x+y+z);
}
Following is a challenge with Visual studio for a beginner,
How many times is the initialization part of the for loop carried out?
Give the output of the following code :
void main()
{
int var = strcmp("Hello","World");
printf("%d", var);
}
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);
}
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();
}
Which of the following is an example of looping in C?
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 are the user interfaces that help to debug a program with Visual Studio:
Versions of Visual Studio are,
What is the general syntax to call a function in C?
Boiler Plate code is auto-generated in Visual Studio by,
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);
}
The last element of the array arr[10] is accessed by :
Which of the following functions is used to rename a particular file?
Visual Studio is NOT
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;
}
How many elements does the array arr[25] contain?
Which of the following statements are true about keywords in C?
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));
}
Visual Studio is NOT
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");
}
}
In C, a function can be called from :
Which of the keywords denote the size and type of a variable in C :
For a given C program, a function can be called :
Give the output of the following code snippet :
int x;
void main()
{
printf("%d", x);
}
Give the output of the following code snippet :
void dummy() {};
void main()
{
dummy();
}
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 :
int main()
{
int i=0;
if(i--)
{
printf("%d",i++);
main();
}
else
printf("%d",--i);
}
The main function in a given program cannot be called recursively. State true or false :
The value obtained in the function is returned to main() by using which keyword?
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 a=10;
switch(a--)
{
case 10 :
printf("%d ",a);
break;
case 10*10/10 :
printf("%d ",a++);
case 11:
printf("%d",a--);
break;
default:
printf("Hello");
break;
}
}
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","a+");
fseek(fp,10,SEEK_SET);
fputc('S',fp);
fclose(fp);
fp1=fopen("Test.txt","r");
while((x=getc(fp1))!=EOF)
{
printf("%c",x);
}
fclose(fp1);
}
Which of the following is the default method to pass arguments in C?
Wizard in Visual studio is normally a set of,
Which of the following are file positioning functions in C?
If two strings are identical, then what does the strcmp() function return?
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 modes is used to indicate line buffering of text files in the setvbuf() function?
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("%f\n", var.f);
}
What are the arguments that the fopen() function takes?
Which of the following is used to represent comments in C:
Give the output of the following code snippet :
struct student
{
int no;
};
void main()
{
struct student s;
no=10;
printf("%d",no);
}
Show the correct order of execution for creating and executing a program in Visual Studio:
Wizard in Visual studio is normally a set of,
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);
}
Which of the following statements is true about a minimal function in C?
Give the output of the following code :
void main()
{
char str1[]= {0};
printf(str1);
}
In which header file is the integer expression errno declared?
What is the green play button in the Visual studio does?
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 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;
}
}
Which of the following are the user interfaces that help to debug a program with Visual Studio :
Following is a challenge with Visual studio for a beginner,
Give the output of the following code snippet :
int main()
{
int i=0;
while(!i++)
{
printf("%d",i--+ ++i);
main();
}
}
Which is NOT 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);
}
What is the return type of the getchar() function?
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 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 : 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()
{
char arr[11]="The African";
printf("%s",arr);
}
When a program begins execution, which of the following streams are open?
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()
{
struct temp
{
int a;
char b;
struct temp1
{
char c;
} p;
};
struct temp t1 = {10,'A','e'};
printf("%d %c %c ",a,b,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);
}
}
Name the three main parts of a for loop 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 func()
{
int i=1;
while(!i)
{
func();
exit(0);
}
printf("%d",i++);
}
void main()
{
func();
}
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);
}
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]);
}
Give the output of the following C code:
int mult(int a, int b)
{
return a*b;
}
int sum ( int a, int b)
{
return a+b;
}
void main()
{
int a=10,b=2;
int t1=mult(a,b);
int t2=mult(3,30);
printf("Sum = %d", sum(t1,t2));
}
Which of the following statements is not true about the tmpfile() function?
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 :
void main()
{
char new1[]= { 0 };
strcpy(new1,"Jello");
int n=strlen(Jello);
printf("%d ",n);
}
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);
}
What is the method used to pause an application at a particular point ?
Which of the following modes is used to indicate full buffering in the setvbuf() function?
Which of the following statements are used to alter the flow of control in a C program :
Which function causes the buffered but unwritten data to be written to the file on an output stream C?
The keyword 'break' cannot be used within :
Give the output of the following code snippet :
void main()
{
static double x;
int x;
printf("x is %d", x);
}
Which of the following is true for static variable?
Give the output of the following code snippet :
void main()
{
printf("Before continue ");
continue;
printf("After continue\n");
}
Which mode is used to denote opening the text file for update but discards any previous contents if any?
A stream is connected to a file or device by :
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 :
void main()
{
int arr[10]= {5};
printf("%d %d",arr[1],arr[9]);
}
Which of the following is not a logical operator in C ?
Which of the following is related to a Microsoft Development tool package.
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);
}
Visual Studio has
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);
}
What are the two arguments that are passed to the strcpy function for string manipulation in C?
Which of the following statements is true about Strings in C :
Give the output of the following C code:
int mult(int a, int b);
void main()
{
int a=10,b=2;
int t1=mult(a,b);
int t2=mult(3,30);
printf("Sum = %d", t1+t2);
}
int mult(int a, int b)
{
return a*b;
}
Give the output of the following code snippet :
void main()
{
Test();
}
void Test()
{
printf("Hello");
}
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 test();
void main()
{
test();
test();
}
void test()
{
static int x = 5;
x++;
printf("%d", x);
}
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");
int i=0;
while(fgets(x,5,fp)!=NULL)
{
}
puts(x);
fclose(fp);
}
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;
}
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);
}
Which of the keywords denote the scope of a variable in C :
Versions of Visual Studio are,
Which of the keywords denote the scope of a variable 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);
}
Give the output of the following code snippet :
int main()
{
do
printf("In while loop ");
while (0);
printf("After loop\n");
}
Which of the following statements is true about the EOF character in C?
Name the looping statements available 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,*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);
}
What is the escape sequence used to denote a double quote in C?
What does the fclose() function take as the argument?