0% found this document useful (0 votes)
4 views39 pages

C Practical File Ranik

This document is a practical lab file for a C programming course at Farefield Institute of Management of Technology. It includes a list of programming tasks, such as converting temperature, finding the greatest number, checking for prime numbers, and working with arrays and structures. Each task is accompanied by a code section and output section, indicating the structure of the practical assignments.

Uploaded by

Ranik Prabhakar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views39 pages

C Practical File Ranik

This document is a practical lab file for a C programming course at Farefield Institute of Management of Technology. It includes a list of programming tasks, such as converting temperature, finding the greatest number, checking for prime numbers, and working with arrays and structures. Each task is accompanied by a code section and output section, indicating the structure of the practical assignments.

Uploaded by

Ranik Prabhakar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

FAREFIELD INSTITUTE OF MANAGEMENT OF TECHNOLOGY

Practical LAB FILE

C PROGRAMMING

SUBJECT CODE:- BCA(171)

SUBMITTED TO:- SUBMITTED BY:-

HARSHITA SHARMA RANIK PRABHAKAR


ASSISTANT PROFESSOR 001151402021
IT FACULTY BCA(1 SEM)
ST
TABLE OF CONTENT

S.NO CONTENT P.NO

1) Write a program to convert temperature from Celsius 1-2


to Fahrenheit by taking input from the user.

2) Write a Program To Find Greatest Number Among 3-4


Three Numbers Given By The User.

3) Write a Program To Check If a Given Number Is a Prime 5-6


Number Or Not.

4) Write a program to display the following pattern upto N 7-8


rows, taking the value of N from the user.

5) Write a program to input marks of 50 students using 9-10


array and display the average marks of the class.

6) Write a program to search for a number entered by the user in 11-


a given array and display the array in ascending order. 12

7) Write a program to check if a string is palindrome or 13-


not. 14

8) Write a Program To Add Subtract Multiply And 15-


Divide Two Numbers Using Pointers. 16

9) Write A Program To Read Time In String Format And Extract 17-


Hours, Minutes And Seconds Also Check Time Validity. 18
10) Write a program to convert a hexadecimal number into a binary 19-
number. 21

11) Write a program to calculate factorial of a number and display 22-


fibonnic series upto N terms using recursive functions. 23

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.

PRACTICAL 10:- Write a program to convert a


hexadecimal number into a binary number.
CODE:-

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:-

a)Use of arrays as a structure data member:-

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.

You might also like