C/C++ Assignments: Basics
C/C++ Assignments: Basics
Basics
1. Write a program to convert Fahrenheit value to Celsius value.
Formula : C=(F -32)/1.8
2. Write a program to print corresponding ASCII value of a character
3. Write a program to swap values of two variables using function
4. Write a program to print the following output:
1
22
333
4444
55555
****
*
*
****
n
1
2
3
4
5
r
0.1
0.11
0.12
0.13
0.14
SI=P(1+r)n
sin x=x
1+ 12
x 3 x 5 x7
+ .
3! 5 ! 7 !
13 1 4
+ .
3 4
60 p per unit
80 p per unit
90 p per unit
1
variance= ( x ix )2
n i=1
std .deviation= variance
n
where
x =
1
x
n i=1 i
9. Write a program with power function, which has two arguments - the
number and the value to which it is to be raised.
If no value for the power is provided, then the default is two.
10.Write a program to Calculate the area of triangle and circle through
overloaded area () function.
Area of triangle =
baseheight
2
Area of circle = r2
11.Write a program to find average of squares of numbers from 1 to 10.
12.Write a program to print direction based on x and y coordinates.