Thanks to visit codestin.com
Credit goes to www.scribd.com

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

POP Module2 Question Bank

The document is a question bank for the Principles of Programming using C course at Bapuji Institute of Engineering and Technology. It covers topics such as operators, type conversion, typecasting, decision control statements, and looping statements, providing various questions and programming tasks for students. The questions aim to assess understanding and application of C programming concepts through examples and coding exercises.

Uploaded by

vishwanathhhh1
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)
13 views2 pages

POP Module2 Question Bank

The document is a question bank for the Principles of Programming using C course at Bapuji Institute of Engineering and Technology. It covers topics such as operators, type conversion, typecasting, decision control statements, and looping statements, providing various questions and programming tasks for students. The questions aim to assess understanding and application of C programming concepts through examples and coding exercises.

Uploaded by

vishwanathhhh1
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

Bapuji Educational Association (R)

Bapuji Institute of Engineering and Technology, Davangere


First Year

Question Bank- Module- II


Sub: Principles of Programming using C Semester: 1st
Sub code: BCSESC103 Section: All
Module 2

Operators, Type conversion and Typecasting


1. List all the operators used in C. Give examples
2. Write a note on the following operators. i) Relational ii) Logical iii) Conditional
3. Demonstrate the functioning of Bitwise operator in C
4. Explain any five operators used in C language
5. What is an operator? List and explain various types of operators supports in C.
6. What is an assignment operator? Give the different general form of an assignment
statement with an example.
7. Differentiate between typecasting and type conversion. Illustrate with an example.
8. Give the operator precedence chart.
9. Write a program to calculate salary of an employee, given his basic pay (to be entered
by the user), HRA = 10% of the basic pay, TA = 5% of basic pay. Define HRA and
TA as constants and use them to calculate the salary of the employee.
10. Develop a C program that takes three coefficients (a, b, and c) of a quadratic equation;
(ax2 + bx + c) as input and compute all possible roots and print them with appropriate
messages
11. Convert the following mathematical expression into C equivalent
I. area= s(s-a)(s-b)(s-c)
II. x = -b + b2 -4ac
12. Evaluate the following expression:
I. a + a*b/c-b where a=6, b=3, c=2
II. 100 % 20 < = 20 – 5 + 100 % 10 – 20 = = 5 > = 1! = 20
III. a + = b * = c - = 5 where a=3 b=5 and c=8
IV. (x > y) + ++a ||! c where x=2, y=3, a=4, c=4
V. - -a*(5+b)/2-c++ * b where a=0, b=1, c=-1

13. Find the output of the following codes.


I. #include<stdio.h>
int main ()
{
int x=3, y=5, z=7;
int a, b;
a=x*2+y/5-z*y;
b= ++x * (y- 3) / 2-z++ * y;
printf("\n a = %d", a);
printf("\n b = %d", b);
return 0;
}

II. #include<stdio.h>
int main ()
{
int a=4;
printf("\n %d", 10+a++);
printf("\n b = %d", 10+ ++a);
return 0;
}

Decision Control and Looping Statements


1. What are decision control statements? List out all conditional branching statements
supports in C. Explain in detail with syntax and example
2. Explain with syntax, if and if-else statements in C program
3. What is Dangling-else problem. Illustrate with an example.
4. Explain switch statement with syntax. Write a C program to simulate calculator
5. List out what are the advantages of using a switch case statements in C.
6. What are iterative statements? Write a short note on iterative statements that C
language supports with syntax.
7. Explain different types of loops in C with syntax.
8. Give the points of similarity and differences between a while loop and a do-while
loop.
9. Illustrate Nested loops in C with suitable example
10. Explain the working of goto statement in C with an example
11. Distinguish between the break and continue statement
12. Show how break and continue statements are used in C program with example.
13. Develop a simple calculator program in C language to do simple operations like
addition, subtraction, multiplication and division. Use switch statement in your
program
14. Write a C program to print whether a given number is palindrome or not.
15. Write a C program to check whether a given number is even or odd.
16. Write a C program to find the largest of three numbers using nested if statement.
17. Write a program to find the factorial of a number using loops.
18. Write a C program to find the sum of odd numbers n natural numbers using do-while
loop.
19. Write a program in C to print the numbers from 4 to 9 and their squares.
20. Write a program to print the following pattern

21. Write a C program to generate and plot Pascal’s triangle.

You might also like