0% found this document useful (0 votes)
57 views2 pages

Experiment-I: Conditional Statements & Loops

This document outlines the experiments for a C Programming and Data Structures lab course. The course is worth 2 credits and includes 6 experiments covering conditional statements and loops, functions, arrays, character arrays and strings, pointers, and structures. Experiment 1 involves arithmetic operations, prime numbers, and reversing numbers. Experiment 2 covers recursion, exponents, and Fibonacci series. Experiment 3 deals with arrays and pairs summing to 50, interchanging elements, and removing duplicates. Experiment 4 involves abbreviating names, reversing strings, and inserting/deleting substrings. Experiment 5 uses pointers with quadratic equations, deleting characters, and concatenating strings. Experiment 6 works with structures for student and hotel data including editing, grading, and room charges. Experiment 7 handles

Uploaded by

balaji
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)
57 views2 pages

Experiment-I: Conditional Statements & Loops

This document outlines the experiments for a C Programming and Data Structures lab course. The course is worth 2 credits and includes 6 experiments covering conditional statements and loops, functions, arrays, character arrays and strings, pointers, and structures. Experiment 1 involves arithmetic operations, prime numbers, and reversing numbers. Experiment 2 covers recursion, exponents, and Fibonacci series. Experiment 3 deals with arrays and pairs summing to 50, interchanging elements, and removing duplicates. Experiment 4 involves abbreviating names, reversing strings, and inserting/deleting substrings. Experiment 5 uses pointers with quadratic equations, deleting characters, and concatenating strings. Experiment 6 works with structures for student and hotel data including editing, grading, and room charges. Experiment 7 handles

Uploaded by

balaji
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/ 2

Year & Lab Lab Name: C Programming No.

of L T&PS P
Sem: Code: and Data Structures Lab Credits: 2 0 0 2
E1S1 CS6701
Experiment-I: CONDITIONAL STATEMENTS & LOOPS
1. Write a C program to perform all arithmetic operations on given two numbers.
2. Write a C program to print the Prime numbers in a given range.
3. Write a C program to print the reverse of the given number.
Experiment-II: FUNCTIONS
1. Write a C program to read an integer number and print the reverse of the number using
recursion.
2. Write a C program using function to calculate x to the power of y, where y can be either
negative or positive.
3. Write a C program to print the Fibonacci series
a. Using recursion
b. Without using recursion
Experiment-III: ARRAYS
1. Write a C program that reads an array of 100 integers. Display all pairs of elements
whose sum is 50.
2. Write a C program to interchange the second largest element with the second last
element.
3. Write a C program to delete duplicate values from an array.
Experiment-IV: CHARACTER ARRAYS & STRING OPERATIONS
1. Write a C program to read a name and then display it in abbreviated form as follows:
a. Rajiv Gandhi University of Knowledge Technologies should be displayed as
RGUKT.
b. Avul Pakir Jainulabdeen Abdul Kalam should be displayed as A.P.J.A.Kalam
2. Write a C program to input a text. Then reverse the string in the format shown below.
“HAPPY BIRTHDAY TO YOU” should be displayed as “YOU TO BIRTHDAY
HAPPY”.
3. Write a C program to read text and then
a. Insert a string in the text.
b. Delete a substring from the text.
Experiment-V: POINTERS
1. Write a function to calculate roots of a quadratic equation. The function must accept
arguments and return result using pointers.
2. Write a function that accepts a string using pointers. In the function, delete all the
occurrences of a given character and display the modified string.
3. Write a C program to concatenate two strings using pointers.
Experiment-VI: STRUCTURES
1. Write a program to read and display the information of all the students in a class. Then
edit the details of the ith student and redisplay the entire information.
2. Write a program to define a structure for a hotel that has members-name, address, grade,
number of rooms, and room charges.
a. Write a function to print the names of a hotel in a particular grade.
b. Write a function to print the names of hotels which have room charges less than
the specified value.
3. Write a program using pointers to a structure to initialize the members in the structure.
Use functions to print the student‟s information.
Experiment-VII: FILES
1. Write a C program to read each integer values stored in the file. While reading the value,
compute whether the value is even or odd. If it is even then write that value in a file
called EVEN.TXT else write it in ODD.TXT. Finally display the contents of the two files
– EVEN.TXT and ODD.TXT.
NOTE: Assume that a file “INTEGERS.TXT” stores only integer numbers. A value „-1‟
is stored as the last value to indicate EOF.
2. Write a C program to read a text file, convert all the lower case characters into upper
case and re-write the upper case characters in the file. Before the end of the program, all
temporary files must be deleted.
3. Write a menu-driven C program to read, insert, append, delete, and edit a record stored in
a binary file.

You might also like