Beruflich Dokumente
Kultur Dokumente
List of programs
Week 1:
1. Write a C program to find the greatest and smallest of three numbers.
2. Write a program in C for the Air force to label an aircraft a military or civilian.
The program is to be given the plane's observed speed in km/h & its estimated
length in meters. For plane travelling in excess of 1100km/h & longer than
52m, you should label them as "civilian" aircraft, & shorter such as 500 km/h
& 20m as "military" aircraft. For planes travelling at slower speeds, you will
issue an "It's bird" message.
3. Write a C program for the following problem.
The National Earthquake Information Center has the following criteria to
determine the earthquake damages. Here is the given richter scale serve as an
input data and the characterization as output information.
RICHTER NUMBER (N)
CHARACTERIZATION
N<5.0
little or no damage
5.0<=N<5.5
some damage
5.5<=N<6.5
serious damage
6.5<=N<7.5
Disaster
Higher
Catastrophe
4. Write a program in C that accepts dates written in numerical form and then
output them as a complete form.
Sample input:
2 26 1986
Sample output:
February 26, 1986
5. Get the input as name of a person and his age in years. Write a C program to
compute how many seconds that person have lived till this age.
Week 2:
1. Write a C program to convert the Fahrenheit value into Degree Celsius value.
2. Write a C program to solve the roots of a quadratic equation and print all the
possible roots. Use switch statements to handle different values of the
discriminant d = b2 4ac
3. Write a C program to check whether a given integer is Palindrome or Not.
1.
2.
3.
1 2
2 2
2 3
1 2 3
3 3 3
4 5 6
1 2 3 4
4 4 4 4
7 8 9 10
1 2 3 4 5
5 5 5 5 5
11 12 13 14 15
Write a C program to compute the exponential value of a given number X
using the following series.
e(x) = 1 + x + x2 / 2! + x3 / 3! +
4.
Write a C program to compute the Cosine value of a given number X using the
following series.
Cos(x) =
5.
1 - x2 / 2! + x4 / 4! - x6 / 6! +
Write a C program to compute the Sine value of a given number X using the
following series.
Sin(x) =
x - x3 / 3! + x5 / 5! - x7 / 7! +
Week 5:
1. Write a C program to perform the following number conversions.
i. Decimal to Binary
ii. Binary to decimal
iii.
Decimal to Hexadecimal
iv. Hexadecimal to Decimal
2. Write a C program to compute the mean, variance and standard deviation for a
given set of numbers using the following formula.
QuickTime and a
decompressor
are needed to see this picture.
where x1, x2, x3, .xN are the given set of N numbers whose mean value
is and standard deviation is
Week 6:
1. Write a C program to order the elements of an integer array using Bubble Sort
and print it in ascending and descending order.
2. Write a C program to find the sum of odd and even numbers in an integer
array.
3. Write a C program to perform Linear search for a given number X in an
Week 7:
1. Write a C program to find the transpose of a matrix.
2. Write a C program to find the sum of two diagonal elements of a n*n matrx.
3. Write a C program to find the saddle points in a matrix. It is computed as
follows:
Find out the smallest element in a row. The saddle point exists in a row if an
element is the largest element in that corresponding column. Consider the
following example.
7 5 6
10 2 3
1 3 3
In the above 3*3 matrix, in Row1, the saddle point exists at Column2. In
Row2 and Row3, the saddle points does not exist.
4. Write a C program to generate a n*n ( where n is an odd integer ) magic
square such that the sum of any row or column elements must be the same.
Example:
7 5 3
2 9 4
6 1 8
Week 8:
1. Write a User-Defined Function in C to swap two numbers using :
i.
Call By Value
ii.
Call By Reference
if N <= 1
1) + Fibonacci(N-2)
if N >= 2
5. Write a C program to find the GCD of two numbers using Recursion. The
Recurrence Relation is :
GCD(a, b) =
GCD(b,
a
a mod b)
if b = 0
if b > 0
Week 9:
1. Write a C program for the following string manipulation functions without
using built-in functions.
(i) strcat (ii) strcpy (iii) strcmp (iv) strlen (v) strrev
2. Write a C program to count the number of 3 letter words in a given sequence.
Assume that words are separated by blank space and the sequence is
terminated by a period(.)
3. Write a C program to check whether a String is Palindrome or Not.
Week 10:
1.
2.
3.
i.
ii.
iii.
iv.
Week 11
1.
2.
3.
Week 12
1. Write a C program to create N number of Student records having the following
fields :
Field Name
Data Type
-------------
-------------
Name
String
RollNo
Integer
Mark
Total
Integer
Average
Data Type
---------------
-------------
Name
String
EmpID
Integer
Dept
String
Design
String
BasicPay
Get any one Employee id as an input from the created list. For that employee,
calculate the following salary allowances and display all his details.
DA
45 % of BasicPay
HRA =
12 % of Basic Pay
CCA =
Rs 400 /-
GP
AP
( GP * 12 )
PF
25 % of BasicPay
NP
GP ( PF + IT )
IT = 0.0
if AP < 60000
ii.
IT = 0.1 * GP
iii.
IT = 0.2 * GP
iv.
IT = 0.25 * GP
if AP > 180000