C Practice Test on Storage Classes

“C Practice Test on Storage Classes”: Write this C Practice Test Online to test your skills on technical and objective type questions on Storage Classes


1. What is the Output of following Code?
#include <stdio.h>
void main()
{
extern int i;
printf(“%d”,i);
}

 
 
 
 

2. What is the Output of following Code?
#include <stdio.h>
void main()
{
val();
val();
}
void val()
{
auto int a=3;
a=a+3;
printf(“%d\n”,a);
}

 
 
 
 

3. What is the Output of following Code?
#include <stdio.h>
static int i=10;
int main()
{
i=5;
for(i=0;i<5;i++)
{
static int a=10;
printf(“%d,”,a++);
}
return 0;
}

 
 
 
 

4. What is the Output of following Code?
#include <stdio.h>
int main()
{
int a ;
printf(“%d”,a);
return 0;
}

 
 
 
 

5. What is the Output of following Code?
#include <stdio.h>
extern int i;
int main()
{
i=25;
printf(“%d”,i);
return 0;
}
int i=10;

 
 
 
 

6. What is the Output of following Code?
#include <stdio.h>
void main()
{
const int x=5;
const int *ptrx;
ptrx = &x;
*ptrx = 10;
printf(“%d\n”, x);
return 0;
}

 
 
 
 

7. What is the Output of following Code?
#include <stdio.h>
void main()
{
val();
val();
}
void val()
{
static int a=3;
a=a+3;
printf(“%d\n”,a);
}

 
 
 
 

8. What is the Output of following Code?
#include <stdio.h>
void main()
{
{
auto int a=3;
printf(“a : %d”,a);
}
printf(“a : %d”,a);
}

 
 
 
 

9. What is the Output of following Code?
#include<stdio.h>
int main()
{
register int a=10;
int *p;
p=&a;
printf(“p val : %u”, *p);
return 0 ;
}

 
 
 
 

10. What is the Output of following Code?
#include <stdio.h>
int main()
{
static int a;
printf(“%d”,a);
return 0;
}

 
 
 
 

Question 1 of 10

Share this