0% found this document useful (0 votes)
25 views2 pages

PPS CT-1-Mock Test

Test

Uploaded by

Pranav Harlalka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

PPS CT-1-Mock Test

Test

Uploaded by

Pranav Harlalka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

21CSS101J- Programming for Problem Solving

Mock Test
PART-A
Section: AE-1
1. An Ampersand (&) before the name of a variable denotes _________

a. Actual Value b. Variable Name c. Address d.Data Type


2. What is the output of the following code segment?

int i=1; while(i++<5); printf("%d",i);

a) Syntax error b) 5 c) 6 d) 1

3. Which of the following cannot be checked in a switch-case statement?

a) Integer b) character c) enum d) float

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

5. Fund the output of the following code segment


void main()
{
int a=5,b=6,c=11;
printf("%d%d%d");
}
a) compiler error b) 5 6 11 c) 11 6 5 d) garbage value

PART-B Answer Any Five ( 5 * 4 = 20)

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)

PART – C Answer Any Two (2 * 10 =20)

1. Write a C program to print table of n & square of n using pow()


2. Write a program to print the following pattern
5
44
333
2222
11111

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.

You might also like