You are on page 1of 4

PPS QUESTION BANK

SHORT QUESTIONS:
1) main()
{ int x=5;
printf(“%d”,printf(“%d%d”,z,z)); }
2) Write down the syntax and example on statements: printf, scanf
3) What are the rules for naming an identifier?
4) What will be the output and why?
#include <stdio.h>
int main( )
{ char str[5]= “MOHAN”;
printf("\n%c %c ", str[2], *(3+str));
return 0;
}
5) Find the output when we execute the below statements:
int a,b;
float d;
a=10; b=5;
d=(float)b/a;
printf(“ %d %d %f”,a,b,d);
6) Write down the syntax and example for conditional operators (? And :)
7) What will be the output and why?
#define SUM 10+10
void main()
{ int a;
a=SUM/SUM;
printf(“%d”,a); }
8) void main()
{ while(0)
printf(“ In while Loop “);
printf(“After While Loop”);
} The output of the code is ------
9) main()
{ int i=3;
do{ printf(“%d”,i); }while(--i>0); return 0;
} Output is -----------------

10) What will be the output and why?


#include<stdio.h>
void fun(void)
{
static int x=10;
printf(" %d ",x++);
}
int main( )
{
fun();
fun();
return 0;
}
11) State the difference between break and continue while using in a loop control statements.
12) What is an array ? How to initialize values to an 1D array during its declaration.
13) Write down the syntax and example on else..if ladder

14) What will be the output and why?


#include<stdio.h>
int main()
{ char x= ‘T’;
if(x== ‘T’) printf(“It is TRUE STATE”);
else printf(“It is FALSE STATE”);
return 0;
}
15) what will be the output and why?
main()
{ int K;
for(K=0; K<printf(“Hi”); K++)
printf(“%d”,K);
}
16) What will be the output and why?
#include <stdio.h>
int main( )
{ int x[3]={10,20,30};
printf("\n%d %d",x[0], *(x+1));
return 0;
}
17) void fun(void);
int x=10;
main()
{ fun();}
void fun()
{ printf(“%d”,x++); }
Output is --------------------
18) What will be the output and why?
#include<stdio.h>
int main()
{ int s=1;
if(s) printf(“my land is beautiful”);
else printf(“my country is great”);
return 0;
}
19) What will be the output and why?
#include<stdio.h>
int main( )
{ static int a;
printf(“%d”,a++);
if(a==1)
printf(“%d”,a++);
return 0;
}
20) Differentiate between formal parameter and actual parameter.
21) What is a recursive functions, write an example?
22) What is the role of return statement in a function? Can we write a function which can return more than
one value using return statement?
23) Find the output
int x,y,z,q;
x=10; y=5; z=3;
q=x>y>z;
printf(“%d”,q);
24) what will be the output from below options?
#include<stdio.h>
#define int char
int main()
{ int i=65;
printf(“size =%d”,sizeof(i));
return 0;
}
25) what will be the output and why?
#include <stdio.h>
#define A 1 + 2
#define B 3 + 4
int main()
{
int var = A * B;
printf("%d\n", var);
}
26) Define static variable? How it differs automatic variables?
27) State the difference between recursive and iterative process.

LONG QUESTIONS:
1) Explain briefly about the basic structure of ‘C’ programming.
2) Write a program to input an alphabet and check whether it is an upper case vowel or not.
3) Write a program to input a digit within 0 to 6. Display weekday as per the digit given. (e.g: 0-Sunday,
1-Monday, 2-Tuesday etc)
4) State the difference between break and continue. Explain with an example.
5) Write down the syntax of switch case and briefly explain its usage using a suitable example.
6) Write a program to store N integers using dynamic memory allocation and find their sum.
7) Write a program to store N integers using dynamic memory allocation. Find largest number entered by
the user.
8) Write a program to find the greatest among 3 unequal numbers using switch case.
9) What is dynamic memory allocation? Write down the syntax and example for the functions: malloc(),
calloc(), realloc() and free()
10) Write a program to display the transpose of a given square matrix.
11) Write a program to input data into two 3X3 matrices and perform addition and display the resultant
matrix.
12) What is an array? How to declare and initialize the array? Write down a suitable example for accessing
the elements of an array.
13) Write a program to generate Fibonacci series within 1 to N where N is given input.
14) How an array is different from a structure? Explain with a suitable example.
15) Write a program to find the sum of series: 1+2+3+….+10 using a recursive function.
16) Write a program to generate Fibonacci series using a recursive function.
17) Write a program to find the product of series: 5*4*3*…. *1 using a recursive function.
18) Write short note on the following: break, continue , return , strlen(), pow(),strcmp(), sqrt(), pow()
19) Write a program to input an integer and test whether it is palindrome or not.
20) Write a program to find the greatest common divisor of two numbers using user defined function.
21) Write a program to perform the job of simple calculator for applying arithmetic operations (+, -, *, /, %)
on two operands.
22) Write a program to input a number and test whether it is Armstrong or not? (example of a Armstrong
no: 153 = 13+33+53)
23) Write a program to test a number is prime or not using user defined function.
24) Write a program to swap two numbers using user defined function and call by address concept.
25) Write a program to input 10 elements into an array. Then search for a given value in the array to know
its existence.
26) Write a program to test a string is palindrome or not without using string handling functions.
27) What is a pointer? How a pointer can be used to access the elements of an array, explain with a suitable
example?
28) State the difference between call by value and call by address using a suitable example.
29) Explain the terms with example: Pointer to pointer, Array of pointers, Character pointer
30) A company have 100 employees in total working in different departments such as: production, testing,
research, and marketing. Write a program to create a structure having member’s employee name,
department name, and basic pay. Store all the employee details and then display only those employee
information whose salary>=25000.
31) Write a program to create a structure books having members : Book code, book name, author, cost.
Store 10 books details using structure array. Find the total cost of all books and the costly book exist.
32) CITY BAZAR super market maintains its stock of 100 different products having 4 categories such as:
cosmetics, grains, cloths, stationaries. Write a program to create a structure having member’s product
name, product category, and Maximum Retail Price. Store all the product details and display only those
details whose Maximum Retail Price>=1000.
33) Write a program to create a structure COMPLEX. Input two complex numbers using UDF and find the
sum of them.
34) What is a structure? Write down the syntax and example for defining a structure. Explain about how to
access the members of a structure using suitable example.
35) Write a program to input a string and display the reverse of it.
36) Write a program to check whether the given two strings are equal or not.
37) What are the loop control structures available in ‘C’ language? Briefly explain the syntax and example
on each control structure.
38) Write a program generate pyramid given below:
A
A B C
A B C D E
A B C D E F G
39) Write a program to generate the following pyramid using nested for statement:
1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
40) Write a program to input values into two matrices A(4x4), B(4x4). Perform matrix multiplication and
display the resultant matrix.

You might also like