PPS CT-1-Mock Test
PPS CT-1-Mock Test
Mock Test
PART-A
Section: AE-1
1. An Ampersand (&) before the name of a variable denotes _________
a) Syntax error b) 5 c) 6 d) 1
4. Consider the following code snippet. What is the output if ‘x’ is 10?
switch(x)
{
default: printf(“x”);
case 10: printf(“y”);
case 20: printf(“z”);
}
a) yz b)zy c) xx d)xy
1. Outlint the classification of datatypes in C and explain about typedef with an example.
2. Write a C program to print “HelloWorld” without using semicolon anywhere in the
code?
3. Write the Condition in IF statement such that output it will print as “I Love C
language”
4. Evaluate the expression & represent the order of evaluation based on precedence with
neat diagram. (X=10,Y=2,Z=4,A=12,B=5,C=13,D=9,E=1)
a. Z=X+Y*Z/4%2-1
(A>B)&&(A<B)+(B<=C)*D+E;
5. Explain Extern and Register of storage class using C program?
6. Write a program to identify even or odd number without using any arithmetic , logical
& relational operator?
7. Find output for the following and give explanation with necessary steps,
a. void main()
{
int x=2,y=0;
int z= (y++)?2:y==1&&x;
printf(“z=%d”,z);
8. Solve:
i) a= 4/2*(2-6)-7^2
ii) c=(2==2)?(5++):(- -6)
3. (i) Explain the difference in declaration of local variable sand global variable using
the concept of function?
(ii) Write an algorithm and pseudocode to find Fibonacci series till term <= 1000
4. Write a program to print the following pattern
5. Write a C program that computes all the integer numbers between 1 and 100 that are
divisible by 3 but not divisible by 6 and 9.
6. Students of a university given with login credentials in such a way that user name is
their 10 digit register number (Eg: 1102601002) and password is a four digit number
which is reverse of last four digits in the register number ( Eg: 2001). A student must
use this login credentials whenever they want use computer in the university. Help the
university to develop a C program to verify students’ login credential.