Problems exercises(Branching,Loop, Array, String, & Function) (1)
Problems exercises(Branching,Loop, Array, String, & Function) (1)
9 Write a C program to input any character and check whether it is alphabet, digit
or special character.
13 Write a C program to input a triangle's angles and check whether the triangle is valid
or not.
Switch case
19 Write a C program to check whether a number is even or odd using switch case.
21 Write a switch statement that will examine the value of an integer variable called
flag and print one of the following messages, depending on the value assigned to
flag. (a) HOT, if flag has a value of 1
(b) LUKE WARM, if flag has a value of 2
(c) COLD, if flag has a value of 3
(d) OUT OF RANGE if flag has any other value
22 Write a C program to takes input character variable and print one of the
following messages,
(a) RED, if either r or R is assigned to the variable
(b) GREEN, if either g or G is assigned to the variable
(c) BLUE, if either b or B is assigned to the variable
(d) BLACK, if variable is assigned any other character
LOOP (35 + 4)
1 Write a C program to print the first n natural numbers
14 Write a C program to count the odd and even numbers from a list of n
Nested Loop
3 program to find the sum of all array elements except its index value /element. Write a
8 Write a C program to put even and odd elements in two separate array.
2D Array
1 String ( 12 )
string.
Function ( 8 )
2 Write a C program using functions to find the diameter of a circle where the radius
is given.
3 Write a C program using functions to find the circumference of a circle where the
radius is given.
4 Write a C program using functions to find the area of a circle where the radius is given.
8 Write a C program using functions to check whether a number is perfect number or not.
10 Using functions, write a C program to find all prime numbers between given intervals.
11 Using functions, write a C program to find all perfect numbers between given intervals.