C++programs Exercices-1-3
C++programs Exercices-1-3
Exercise 1 :
Write a C++ program to calculate Fubanaci numbers Xn, n=1,2, …,1000
Xn+1 = Xn+ Xn-1, X0=1, , X1=1, n=1,2,…
Exercise 2:
Write a C++ program TO REARRANGE A LIST OF RANDOUM
NUMBERS Xn INTO ASCENDING ORDER
Exercise 3:
Write a C++ program to get mean of the degrees of student
( Math = 80 , Science =67, Arabic= 65 , Studies= 88 , English = 56.
Exercise 4:
Write a C++ program to transfer inchs to centimeters (1 inch= 2.54
cintimeters)
Exercise 5:
Use for loop to get the factorials of n positive intergers 1,2,…,1000
Exercise 6 :
Write a C++ program to get the volume and the area of a sphere or radius r
Exercise 7:
Write a C++ program to get the volume and the area of a cylinder of radius
r and height h
Exercise 8:
Write a C++ program to get the sum of the series
1 1 1 1 1
SUM 1 ...
2 3 4 99 100
Exercise 9 :
Write a C++ program to get the sum of the series
1 1 1 1 1
SUM 1 ...
2! 3! 4! 99! 1000!
Exercise 10:
Write a C++ program to get the sum of the series
SUM 1 33 53 7 3 ... (1) n (2n 1), n 333
Exercise 11:
Write a C++ program to solve the second degree equation
A X2+B X + C = 0, where the inputs are the coefficients A, B and C
1
Exercise 12:
Write a C++ program to inter N random values between 0 and 100 and get
their mean and the standard deviation sd
N 1
i0 X i
N ( X ) 2
sd i 0
i
,
N N 1
Exercise 14 :
Write a C++ program to inter the elements of the two matrix A and B
and their sum and difference where
1 2 3 3 1 3
A 1 0 3and B 1 0 2
7 4 1 0 4 1
1 2
x x
2 n 1
n
x n 1
n 1 and X0 > 0
Exercise 16- Write a C++ program to get the result of the multiplication of
two matrices
1 2 3 3 1 3
A 1 0 3 and B 1 0 2
7 4 1 0 4 1
Exercise 17-
Write a C++ program to calculate the sum of the series
1-1/2+1/3+ . . . +1/999
Exercise 18:
Exercise 19:
2
Exercise 20:
Exercise 21:
Exercise 22:
Write a program that takes a series of numbers and counts the number of
positive and negative values.
Exercise 23:
Exercise 24:
Write a c++ program to get the sum of a squarec of odd numbers between 22
and 389
Exercise 25:
Write a C++ program to enter names and degrees of student and give the
grades according to the degree
Exercise 26:
Write a C++ program to calculate the area of a triangle with sides a,b
and c