Cpu Set
Cpu Set
Cpu Set
A=sqrt(S(S-a)(S-b)(S-c))
Where a,b and c are sides of the triangle and 2S=a+b+c. Write a program to compute the
area of the triangle given the values of a,b and c
.
6. Write a program to Convert temperature in Celsius to Fahrenheit /
Fahrenheit to Celsius.
F= (9/5) *C + 32
7. Write a program to find the sum of the digits of a 3-digit integer constant.
8. Write a program to interchange the values of two variables.
9. Write a program to Assign value of one variable to another using post and pre
increment operator and print the results.
10. Write a program to Read the price of item in decimal form e.g. 12.50. Separate
rupees and paisa from the given value e.g. 12 rupees and 50 paisa.
SET 2 :Write a “C” program using if , if-
else ,switch.
1. Write a program to read marks from keyboard and your program should display
equivalent grade according to following table.
Marks Grade
100-80 Distinction
60-79 First class
35-59 Second class
0-34 Fail
2. Write a program for Solution of quadratic equation
3. Make Simple Calculator using switch and if …else if
4. Find maximum and minimum of three numbers using ternary operator.
5. Check if the given year is leap year or not. ( Use full condition
for leap year )
6. Convert the case of a given character ( i.e. upper to lower & vice
versa ) ( Use getchar & putchar )
7. Find maximum / minimum of 3 numbers using if and also using
the Ternary operator.
8. Write a program to find out Net salary, HRA, DA, PI of
employee according to Basic salary. Do using if and also using
switch statements.
Net salary=Basic+HRA+DA+PI
1. Write a program to Print 1st N natural numbers & calculate their sum
& avg.
2. Write a program to Print squares / cubes of 1st N natural numbers &
calculate their sum & avg.
3. Write a program to Print all numbers between -n & +n.
4. Write a program to Print 1st N odd / even numbers & calculate their
sum & avg.
5. Write a program to Print all numbers between given two numbers x &
y including x & y, & calculate their sum & avg.
6. Write a program to print all odd/even numbers between given two
Numbers x & y including x & y, & their sum & avg.
7. Write a program to print every third number beginning from 2 until
Number < 100, & calculate their sum & avg.
8. Write a program to print all numbers exactly divisible by 5 until
number < 100, & calculate their sum & avg. Use modulus operator to
check Divisibility.
9. Write a program to Print the following series: -15, -10, -5, 0, 5, 10, 15.
10. Write a program to Print the value of the following series : -1, x, -x2,
x3, -x4, .....
11. Write a program to Print the value of the following series : sinx,
sin2x,sin3x, sin4x,........sin nx.
12. Write a program to Print the multiplication table of given number X
until n, in the Following format: X x 1 = X
13. Write a program To calculate the power of a number i.e. xy or xn
without using pow() function
14. Write a program to Calculate the factorial of a number.
15. Write a program to Print all letters of the alphabet in upper & lower
case.
16. Write a program to Print all characters between given 2 numbers x &
y.
17. Write a program to Print 1st N numbers of the Fibonacci series.
18. Write a program to Check if the given number is prime or not.
19. Write a program for 1-x+x2/2!-x3/3! +x4/4!…xn/n! terms.
SET 4 : Write a “C ” program for following Pattern..
1
12
123
1234
1
22
333
4444
1
121
12321
1234321
GHIJ
DEF
BC
A
1
01
010
1010
SET 5 : Write a “C ” program Using an ARRAY….
1) Write a program to read string from user and print the lenght of the
string
4) Write a program to read your name and ouput the ascii code of the
first character representing your name
5) Write a program to print each word of the given string into seperate
line
1. Write a program in C++ which read name, age of student using class
and display it.
2. Implement a C++ program using scope resolution operator.
(The program should declare three variable with same name, one
should be global and the rest two should be declared in two
different blocks.)
3. write a program in C++ to swap two varibles using function(call by
refernce.
4. Write a program in c++ to calculate the area of triangle using inline
function.
5. Write a program in c++ to calculate the volume of
cube,cylinder,rectangle using function overloading.
6. Write a program in c++ to calculate factorial using friend
function(Also use constructor).