C Practical File Ranik
C Practical File Ranik
C PROGRAMMING
12) Write a program to make use of arrays with structures in the 24-
following ways: 27
a) Use of arrays as a structure data member
b) Create array of structure variables
13) Write a program to perform Input/Output and make use of file 28-
positioning functions on Binary files (using ,f seek, f tell, rewind 29
functions).
Write a program to create two files with names Even File and 30-
14) Odd File. Input 20 numbers from the user and save even 31
numbers in Even File and odd numbers in Odd File.
Write a program to create a structure Employee containing the 32-
15) following data members :Employee( ID,NAME, 34
AGE,ADDRESS,DEPARTMENT AND SALARY).input data for 10
employees and display the details of the employee from the
employee ID given by the user.
PRACTICAL 1:- Write a program to convert temperature
from Celsius to Fahrenheit by taking input from the user.
CODE:-
1.
OUTPUT:-
2.
PRACTICAL 2:- Write a Program To Find Greatest
Number Among Three Numbers Given By The User.
CODE:-
3.
OUTPUT:-
4.
PRACTICAL 3:- Write a Program To Check If a Given
Number Is a Prime Number Or Not.
CODE:-
5.
OUTPUT 1):-
OUTPUT 2):-
6.
PRACTICAL 4:- Write a program to display the
following pattern upto N rows, taking the value of N from the
user.
1
2 3
4 5 6
7 8 9 10
CODE:-
7.
OUTPUT:-
8.
PRACTICAL 5:- Write a program to input marks of 50
students using array and display the average marks of the class.
CODE:-
9.
OUTPUT:-
10.
PRACTICAL 6:- Write a program to search for a number
entered by the user in a given array and display the array in
ascending order.
CODE:-
11.
OUTPUT:-
12.
PRACTICAL 7:- Write a program to check if a string is
palindrome or not.
CODE:-
13.
OUTPUT 1):-
OUTPUT 2):-
14.
PRACTICAL 8:- Write a Program To Add Subtract
Multiply And Divide Two Numbers Using Pointers.
CODE:-
15.
OUTPUT:-
16.
PRACTICAL 9:- Write A Program To Read Time In String
Format And Extract Hours, Minutes And Seconds Also Check Time
Validity.
CODE:-
17.
OUTPUT:-
18.
19.
20.
OUTPUT:-
21.
PRACTICAL 11:- Write a program to calculate factorial of a
number and display fibonnic series upto N terms using recursive
functions.
CODE:-
22.
OUTPUT:-
23.
PRACTICAL 12:- Write a program to make use of
arrays with structures in the following ways:-
CODE:-
24.
OUTPUT:-
25.
b) Create array of structure variables :-
CODE:-
26.
OUTPUT:-
27.
PRACTICAL 13:- Write a program to perform Input/Output
and make use of file positioning functions on Binary files (using fseek,
ftell, rewind functions).
CODE:-
28.
OUTPUT:-
29.
PRACTICAL 14:- Write a program to create two files with
names Even File and Odd File. Input 20 numbers from the user and
save even numbers in Even File and odd numbers in Odd File.
CODE:-
30.
OUTPUT:-
31.
PRACTICAL 15:- Write a program to create a structure
Employee containing the following data members :Employee(
ID,NAME, AGE,ADDRESS,DEPARTMENT AND SALARY).input data for
10 employees and display the details of the employee from the
employee ID given by the user.
CODE:-
32.
OUTPUT:-
33.
34.