Lab Manual
Lab Manual
23
LIST OF EXPERIMENTS
to Fahrenheit.
comma operator.
operator.
operator.
G.L. BAJAJ INSTITUTE OF TECHNOLOGY & MANAGEMENT, GR. NOIDA, DEPT. OF MCA Page 1
Programming for Problem Solving Lab (KCS151P) 2022-
23
operator.
operator.
CONDITIONAL 1 Write a program to input the annual taxable income and CO2
& SWITCH compute the tax according to the given condition.
CASE
STATEMENTS
Total Annual Taxable Tax Rate
Income
5 1
01
101
0101
10101
6 * CO2
* *
* * *
* * * *
7 1 CO2
232
34543
4567654
567898765
4567654
34543
232
1
USER DEFINE 1 Write a program to print out all the Armstrong number
FUNCTION between 100 and 500 using user define function.
4 Write a program to store the following string “zero”, “one” ------- CO4
“five”. Print the no in words, given in figure as 3205.
STRUCTURE 1 Write a union program to extract individual bytes from an un- CO4
& UNION signed int. (for hexadecimal value)
2 Define a structure that can describe a hotel. It should have the CO4
member that includes the name, address, grade, room charge and
number of rooms. Write a function to print out hotel of given grade
in order of room charges.
3 Define a structure called cricket with player name, team name, CO4
batting average, for 50 players & 5 teams. Print team wise list
contains names of player with their batting average.
FILE 1 Write a c program to copy & count the character content of one file CO5
HANDLING says
a.txt to another file b.txt.
2 Write a program to take 10 integers from file and write square of CO5
these
integer in other file.
3 Write a program to read number from file and then write all ‘odd’ CO5
number
G.L. BAJAJ INSTITUTE OF TECHNOLOGY & MANAGEMENT, GR. NOIDA, DEPT. OF MCA Page 4
Programming for Problem Solving Lab (KCS151P) 2022-
23
4 Write a program to print all the prime number, between 1 to 100 in CO5
file
Prime.txt.
GRAPHICAL 1. Write a program to draw circle, line, rectangle fill with red color.
OPERATIONS 2. Draw a moving cycle using computer graphics programming in C.
G.L. BAJAJ INSTITUTE OF TECHNOLOGY & MANAGEMENT, GR. NOIDA, DEPT. OF MCA Page 5