C Practicalfile Format
C Practicalfile Format
Division: 4
Group: 8
CERTIFICATE
Date of Submission:
3 Control Statements
(a) Write a program that determines whether a given integer is
odd or even and displays the number and description on the
same line.
(b) Write a program to find the largest number among the
inputted four numbers using:
(i) Nested if
(ii) Logical operators
(c) Admission to a professional course is subject to the
following conditions:
Marks in Mathematics >= 60
Marks in Physics >= 50
Marks in Chemistry >= 40
Total in all three subjects >= 200 or Total in Mathematics
and Physics >= 150
Given the marks in the three subjects, write a program to
process the applications to list whether the candidate is
eligible or not.
4 Loop Statements
(a) Write a program to calculate the average of a set of N
numbers.
(b) Write a program to count all the prime numbers that lie
between 100 and 200.
(c) Write a program to output the following multiplication
table for any number and display the output in the
following format:
5*1=5
5 * 2 = 10
5 * 3 = 15
..
..
5 * 10 = 50
(d) Write a program to print all integers that are not divisible
by either 2 or 3 and lie between 1 and 100. Program should
also count the number of such integers and print the result.
(e) Write a program to compute and display the sum of all
integers that are divisible by 6 but not divisible by 4 and lie
between 0 and 100. The program should also count and
display the number of such values.
5 Arrays
(a) Write a program to count and print the number of negative
and positive numbers in a given array from the user.
(b) Write a program to read 10 numbers and calculate sum and
mean of the numbers, calculate variance, and calculate
standard deviation.
(c) Write a program to read two matrices A and B and print the
following:
(j) A + B; and (ii) A – B.
7 Strings
(a) An electricity board charges the following rates for the use
of electricity:
For the first 200 units: 80 P per
unit For the next 100 units: 90 P per
unit Beyond 300 units: Rs 1.00 per
unit
All users are charged a minimum of Rs. 100 as meter
charge. If the total amount is more than Rs. 400, then an
additional surcharge of 15% of total amount is charged.
Write a program to read the names of users and number of
units consumed and print out the charges with names.
(b) Write a program that will compute the length of a given
character string.
(c) Write a program that will count the number occurrences of
a specified character in a given line of text.
8 Pointers
(a) Write a program to print the address of a variable along
with its value.
(b) Write a program using pointers to compute the sum of all
elements stored in an array.
9 Structures
(a) Define a structure type, struct personal that would contain
person name, date of joining and salary. Using this
structure, write a program to read this information for one
person from the keyboard and print the same on the
screen.
(b) Create a structure RoomCondition with members {humidity,
temperature and AQI}. Write a program to scan five
readings of room condition and display the average room
condition based on these readings.
10 Files
(a) Write a program to read data from the keyboard, write it to
a file called INPUT, again read the same data from the
INPUT file, and display it on the screen.
(b) Write a program to append additional data to a pre-existing
file and print the total contents of the file.
Table of Contents
i. Theory about the practical
ii. For each sub program
a. Flowchart
b. Hardware and software used
c. Program
d. Output