0% found this document useful (0 votes)
59 views

C Coding Aignment

This document contains 25 programming problems/exercises involving basic mathematical and logical operations such as calculating gross salary, electricity bill, factorials, Fibonacci sequence, checking palindrome, Armstrong number, perfect number, prime number etc. The problems are to be solved by writing C programs and the document includes inputs, outputs and objectives for each problem. It also contains an index section to record the date of experiment and invigilation for the problems.

Uploaded by

crazymind
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

C Coding Aignment

This document contains 25 programming problems/exercises involving basic mathematical and logical operations such as calculating gross salary, electricity bill, factorials, Fibonacci sequence, checking palindrome, Armstrong number, perfect number, prime number etc. The problems are to be solved by writing C programs and the document includes inputs, outputs and objectives for each problem. It also contains an index section to record the date of experiment and invigilation for the problems.

Uploaded by

crazymind
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Objective

15. Write a program to find gross salary of employee if DA is


40% of basic Salary and HRA is 20% of basic salary. Basic salary
will be entered as input by keyboard.
Input

Output

Objective
16. Write a program in C to calculate and print the Electricity
bill of a given customer. The customer id and unit consumed by
the user should be taken from the keyboard and display the
total amount to pay to the customer.
upto 199------------1.20
200-500-------------1.80
Above 500----------2.00
If bill exceeds Rs. 400 then a surcharge of 15% will be charged
and the minimum bill should be of Rs. 1
INPUT
Output
Objective
17. A library charges a fine for every book returned late. For first 5 days
the fine is 50 paisa, for 6-10 days, fine is one rupee and above 10 days,
fine is 5 rupees. If you return the book after 30 days your membership
will be cancelled. Write a program to accept the number of days the
member is late to return the book and display the fine or appropriate
message.

Input
Output

Objective
18. Write a program to find the factorial of any number
Input
Output
Objective
19. Write a program to print Fibonacci sequence 0 1 1 2 3 5 8
13…… N terms and prints the sum of sequence
Input

Output

Objective
20. Write a program in C to accept an integer numbers and find
sum of digits
Input

Output

Objective
21. Write a program in C to accept an integer numbers and find
reverse of this number and check this number for palindrome
Input

Output

Objective
22. Write a program in C to accept an integer numbers and to
check a number is Armstrong or not
Input

Output

Objective
23. Write a program in C to accept an integer numbers and to
check a number is Perfect or not
Input

Output

Objective
24. Write a program to find the sum of following series: S =
2+4+6+8+……………N terms
Input

Output

Objective
25. Write a program to check a number whether it is prime
number or not
Input

Output
INDEX
S.NO Program Date of Date of Remarks
experiment invigilation

1 (a) Write a C program to add two numbers


(b) Write a C program to add three numbers
2 (a) Write a C program to find area of circle
(b) Write a C program to calculate simple interest
3 Write a C program to print a block F using hash (#),
where the F has a height of six characters and width of
five and four characters
4 Write a C program that accepts two item’s weight
(floating points' values) and number of purchase
(floating points' values) and calculate the average value
of the items
5 (a) Write a C program to swap two variables using a
third variable
(b) Write a C program to swap two variables without
using a third variable
6 (a) Write a C program to convert a given integer (in
seconds) to hours, minutes, and seconds.
(b) Write a C program to convert specified days into
years, weeks, and days. Note: Ignore leap year
(c) Write a C program to check whether a number is
even or odd.
7 Write a C program to check whether a given year is Leap
year or not
8 (a) Write a C program to check whether a triangle is
Equilateral, scalene, or isosceles
(b) Write a C program to check whether a triangle is
right angles, obtuse, acute triangle
S.NO Program Date of Date of Remarks
experiment invigilation
9 Write a C program to covert temperature from
Fahrenheit to Celsius and Celsius to Fahrenheit
(User must provide the choice of type of
temperature)
10 (a) Write a C program to check whether a
character is an alphabet, digit
(b) Write a C program a program to check
whether an alphabet is a vowel or consonant
11 (a) Write a C program to find smallest of two
numbers
(b) Write a C program to find largest of three
numbers
12 Write a program in C to implement Simple
Calculator.
13 WAP to calculate the root of a Quadratic
Equation
14 WAP to to accept a coordinate point in a XY
coordinate system and determine in which
quadrant the coordinate point lies
15 Write a program to find gross salary of employee
if DA is 40% of basic Salary and HRA is 20% of
basic salary. Basic salary will be entered as input
by keyboard.
16 Write a program in C to calculate and print the
Electricity bill of a given customer. The customer
id and unit consumed by the user should be
taken from the keyboard and display the total
amount to pay to the customer.
upto 199------------1.20
200-500-------------1.80
Above 500----------2.00
If bill exceeds Rs. 400 then a surcharge of 15%
will be charged and the minimum bill should be
of Rs. 100/-
17 A library charges a fine for every book returned
late. For first 5 days the fine is 50 paisa, for 6-10
days, fine is one rupee and above 10 days, fine is
5 rupees. If you return the book after 30 days
your membership will be cancelled. Write a
program to accept the number of days the
member is late to return the book and display
the fine or appropriate message
S.NO Program Date of Date of Remarks
experiment invigilation
18 Write a program to find the factorial of any
number.
19 . Write a program to print Fibonacci sequence
0 1 1 2 3 5 8 13…… N terms and prints the sum of
sequence.
20 Write a program in C to accept an integer
numbers and find sum of digits.
21 Write a program in C to accept an integer
numbers and find reverse of this number and
check this number for palindrome
22 Write a program in C to accept an integer
numbers and to check a number is Armstrong or
not
23 Write a program in C to accept an integer
numbers and to check a number is Perfect or not
24 Write a program to find the sum of following
series: S = 2+4+6+8+……………N terms.
25 Write a program to check a number whether it is
prime number or not
26 Write a program to find the sum of following
series: 1 – 1/2 + 1/3 – 1/4 + 1/5 - …… up to n
terms.
27 Write a program to find the sum of following
series: 1! + 2! + 3! + 4! + ….. + n!
28 Write a program to find the sum of following
series: S = -1 3 + 33 - 5 3 + 73 – 9 3 + 113 - ……..N
terms.
29 Write a program to find the sum of following
series: S = 1/1! + 2/2! + 3/3! + ………….. 7 terms
30 Write a program to convert binary number to
decimal number
31 Write a program to find the sum of following
series: S = 14 + 34 + 54 + 74 + …………….. 100
terms
32 Write a program in C to print the following
pattern:
* * *
* * *
* * *

You might also like