PSTC UNIT-I & II Questions
PSTC UNIT-I & II Questions
Module 1 / UNIT-I
Syllabus:
Introduction to C Programming: Structure of a C Program, Identifiers, Variables, Constants
and Data Types. Operators-Arithmetic, Relational, Logical, Assignment, increment and
decrement, Conditional, Bitwise and Special Operators. Evaluation of Expressions, Precedence
of Arithmetic operators, Type conversions, Operator precedence and Associativity. Formatted
input and output.
Questions will be starting with the following action verbs.( Highest level-3)
Action verbs:
Apply • Build • Choose • Construct • Develop • Experiment with • Identify • Interview • Make
use of • Model • Organize • Plan • Select • Solve • Utilize.
1. Explain the structure of C program.
2. Define variable. Explain the naming rules for a variable with an example?
3. What are identifiers in C. List out the rules for identifiers?
4. What is a “C” constant? Demonstrate various types of constant declaration with
example?
5. Define Data type? Demonstrate the role of Data types in C language? Explain
classification of data types in C?
6. How declaration statement does is different from initialization?
7. Write a C program to read Fahrenheit temperature and convert to Centigrade
8. Write a C program to read the Marks in3 Subjects and Display the average.
9. Outline the operators of C?
10. Explain about arithmetical operators of C with an example?
11. Explain about Relational operators and Logical operators in C.
12. Explain about type casting in C
13. Explain any four Bit- wise operators with example.
14. Explain about Increment and Decrement operators of C?
15. Explain about unary operators of C?
16. Explain about ternary operators that are available in C?
17. Write a C program for Swapping of two numbers using a third variable
18. Write a C program to implement increment and decrement operators.
19. Write a C program to implement bit wise operators.
20. Explain about printf() and scanf() in C language.
UNIT II or Module II
Syllabus:
Control Statements: Conditional Statements- if, if else, nested if, else if
ladder and
switch statements. Iterative or Loop statements- while, do while and for
statements.Jump statements- break, continue and goto statements.
Course Outcome:
A8501.2. Use control statements for solving a given problem.
1. Write a C program to check whether the given number is even or odd.
2. Write a C program to calculate the Largest of two numbers.
3. Write a C program to Check the given year is leap year or not.
4. Explain about Nested-If statement in C.
5. Write a C program to find the roots of a quadratic equation.
6. Explain about Else-If ladder in C
7. Write a C program to read 3 subject Marks. Calculate and display the grade of
a student based on the following percentages.
< 40 - Fail
Between 41 and 50 – C grade
Between 51 to 60 – B grade
Between 61 to 75 – A grade
Greater than 75 – distinction
8. Write a C program to check whether the given person is eligible to vote or not.
9. Explain about Two-way selection statement in C.
10. Explain about switch statement in C
11. Write a C Program to perform Arithmetic Operations using switch.
12. Write a C program to check whether the given character is vowel or consonant
usingswitch statement.
13. Write a C program to find sum of n natural numbers ( 1+2+3. . . .+n).
14. Write a C program to find factorial of a given number.
15. Write a C program to print Fibonacci numbers.
16. Write a C program to find reverse of the given number.
17. Write a C program to check the given number is Armstrong or not.
18. Write a C program to check the given number is prime or not.
19. Write a python program to find the GCD of given two numbers.
20. Write a C program to print the output in various triangle patterns using Nested
for loop.
21. Write a C program to print the alphabets from A to Z using for loop.
22. What is an Armstrong number. Write a C program to check the given number is
Armstrong or not
23. What is the purpose of ‘for’ loop in C. Demonstrate with an example program.
24. Write a c program to print the following pattern using nested for loop.
1
12
123
1234
12345