Welcome to Your Quiz: Aptitude Test C Programming For Advanced Students​ Level 2

Name Email
1. What are storage classes in 'C' language? choose multiple-
a. auto keyword
b. static keyword
c. register keyword
d. extern keyword
e. automatic
f. static
2. What is the output of the following code?
#include <stdio.h>
extern int a;
main()
{
printf("\n a=%d",a);
return 0;
}
int a=5;
3. What is the output of the following code?
#include <stdio.h>
int a;
main()
{
printf("\n a= %d",a);
return 0;
}
4. What is the output of the following code?
#include <stdio.h>
extern int a;
main()
{
void fun();
printf("\n a=%d",a);
fun();
return 0;
}
int a=7;
void fun()
{
printf("\n in fun a=%d",a);
}
5. What is output of below program?
#include <stdio.h>
int main(int argc, char *argv[]) {
char str1 [] = "newtum" ;
int a = 10;
char str2[12] ;
sprintf (str2, "%s-%d", str1, a) ;
printf ( "%s", str2 ) ; 
return 0;
}
6. What will be the output
main()
{
int i;
i = 10;
printf("%d\t",5,6);
printf("%d", i , i++);
}
7. Which one of the given option is correct?
void main()
{
int i;
i=2;
newtum:
printf("%d",i);
i=i+2;
if(i<=20)
goto newtum;
}
8. How many times the below loop will get executed?
main()
{
int i,j;
i = 10;
for (j=i==10 ; j<=10 ; j++)
{
printf("\n%d",j);
}
}
9. What is the output of the following code?
#include <stdio.h>
main()
{
int i;
for(i=0;i<5;i++)
{
static int a=0;
int b=0;
a++;
b++;
printf("%d %d",a,b);
}
return 0;
}
10. What value of c will get printed
main()
{
int a, b, c;
a = 10;
b = 20;
c = printf("%d",a) + ++b;
printf ("%d",c);
}
11. What will be the output
main()
{
char *ptr = "newtum.com";
char a =
printf("%c", ++*ptr++);
}
12. What is the output of the following code?
#include <stdio.h>
main()
{
static int s;
++s;
printf("%d",s);
if(s<=3)
main();
printf("%d",s);
return 0;
}
13. What is the output of the following code?
#include <stdio.h>
extern int a;
main()
{
printf("\na=%d",a);
return 0;
}
14. What the below statement will print if a=10 and b = 20?
printf("%d",a==b);
15. How many storage class specifiers in "C" language?
16. Which one of the given option is correct?
void main()
{
int i;
i=2;
cskills:
printf("%d",i);
i=i+2;
if(i<=20)
goto cskills;
}
17. What will be the output of the following program?
main()
{
printf("%c","Newtum"[4]);
}
18. How many variables scopes are there in "C" language?
19. What is the output of the following code?
#include <stdio.h>
extern int a=5;
main()
{
void fun();
printf("\n a=%d",a);
fun();
return 0;
}
int a;
void fun()
{
printf("\n in fun a=%d",a);
}
20. How many times the while loop will get executed?
main ( )
{
int a = 1 ;
while ( a <= 100) ;
{
printf ( "%d", a++ ) ;
}
}

Thank You for Submitting your response for Quiz

Aptitude Test C Programming For Advanced Students​ Level 2

Please click on View Result Button to see the Result.



(Visited 8 times, 1 visits today)