C Programming Question Collection. Question Related to I/O Functions, Library Function, Sequential Control Structure, Decision Control Structure, and Unconditional Structure in C Program

–> SOLUTION TO THE QUESTIONS <–

Question Related To I/O Functions

1. Write a program to enter two numbers and find product.
2) Write a program to calculate area of triangle.
3) Write a program to enter two numbers and perform all arithmetic numbers.
4. Write a program to calculate compound Interest.
5. Write a program to enter length of any one side and calculate area and perimeter of square.
6. Write a program to display following outputs using printf() function.

##########
#
#
## #######
#
#

Question Related To Library Function
Write a program to show the use of.
a. <ctype.h>
tolower(char),toupper(char), isupper(),islower(),isdigit(),isalmun()
b) <Math.h>
floor(), ceil(), squr(),log(),pow(base,pow)

Program Practice For Ternary Operators
Solve the following by using ternary operator.
1. WAP to enter a number and check whether the number is odd or even.

Sequential Control Structure
1. Write a program to ask two ask a number from user and display cube of the number without using library function.
2. Write a program to input a number and fint square with and without using math.h libray function.
3. Write a program to enter the length, breadth and height of a box and calculate the total surface area and volume of the cuboid.
4. WAP to enter radius of circle and calculate area and circumference.

–> SOLUTION TO THE QUESTIONS <–

Question Related To Decision Control Structure

A) Question related to If() Statement
1. Write a program to enter the marks of English Subject and print “Pass” if it is 40 or more.
2. Write a program to read a number and find odd or even by using if ()
3. Write a program to enter the age of a person and print “He can vote”, if the age is 18 or above.

B) Question related to If..Else condition
1. WAP to enter marks of English and print “Pass” if it is 40 or more, otherwise “Fail”.
2. WAP to check input number is negative or non-negative.
3. WAP to enter the age of a person and print “He can vote” if the age is 18 or above, otherwise ” He cannot vote”
4. WAP to check whether given number is odd or even.
5. WAP to find the greatest number among two numbers entered by the user.

c) Question Related to Nested if() else.
1. WAP to check the greatest among 3 inputs from user by using nested if() else

D) Questions related to If.. else if
1. WAP to enter a number and print “Positive” if it is greater than 0, “Negative” if it is less than 0 , otherwise print “Zero”.

2. WAP to read marks of 5 subjects and calculate percentage as follows.
i. percentage>=75 and <=100 Distinction
ii. percentage>= 60 and <75 First division
iii. percentage>=45 and <60 second division
iv. percentage>=35 and <45 Pass division
v. percentage>=0 and <35 fail
vi. Otherwise “Invalid Input”

3. WAP to enter 3 numbers and print the greatest number using if… else if
4. WAP to input any three numbers and find the middle number.

–> SOLUTION TO THE QUESTIONS <–

E) Switch()
1. WAP to print name of days according as number input from keyboard such as 1 for Sunday, 2 for Monday…… 7 for Saturday and other for wring input.

2. WAP to print the following menu and do the task accordingly.
a) Area of Rectangle
b) Perimeter of Rectangle
c) Area of circle
d) Area of square

3. WAP to print the following menu and do the task accordingly
Subtraction of two numbers
Multiplication of two numbers
Division of two numbers
Exit
Note: user’s choice should be ‘a’ for addition, ‘s’ for subtraction, ‘m’ for multiplication, ‘d’ for division and ‘e’ for exit.

Question related To Unconditional Statement.
1. WAP to allow user to enter only value under 100 by using Goto statement.

–> SOLUTION TO THE QUESTIONS <–