Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
C_Lab Manual_Part A.docx
1. RATHINAM COLLEGE OF ARTS AND SCIENCE
(AUTONOMOUS)
Eachanari, Coimbatore-21
Laboratory Manual
Degree & Branch B.Sc. (CTIS) B.Sc. IT (DS) & BCA (AI)
Course Code
Course Title Programming in C
2. Index
S.No Date Topic Name
Page
Number
Marks
(20)
PART A
1 Printing the Reverse of a Number
2 Printing the Odd and Even Series of a N Numbers
3 Get a string and convert the lowercase to uppercase
and vice--versa using getchar() and putchar().
4 Input a string and find the number of each of the
vowels appear in the string.
5 Printing the reverse of a string
6 Accept N words and make it as a sentence by inserting
blank spaces and a full stop at the end.
PART B
1 Searching an element in an array using pointers
2
Checking whether the given matrix is an identity
matrix or not
3
Finding the first N terms of Fibonacci series
4
Declare 3 pointer variables to store a character, a
character string and an integer respectively.
Input values into these variables. Display the address
and the contents of each variable
5
Define a structure with three members and display the
same
6
Declare a union with three members of type integer,
char, string and illustrate the use of union
7
Recursive program to find the factorial of an integer
8
Finding the maximum of 4 numbers by defining a
macro for the maximum of two numbers
9
Arranging N numbers in ascending and in descending
order using bubble sort.
3. S.No Date Topic Name
Page
Number
Marks
(20)
10
Addition and subtraction of two matrices
11
Multiplication of two matrices
12
Converting a hexadecimal number into its binary
equivalent.
13
Check whether the given string is a palindrome or not.
14
Demonstration of bitwise operations
15
Applying binary search to a set of N numbers by using
a function
16
Create a sequential file with three fields: empno,
empname, empbasic. Print all the details in a
neat format by adding 500 to their basic salary
Average Marks
4. Write a C Program to print Reverse of a given number
AIM:
Write a C Program to print Reverse of a given number
ALGORITHM:
1. Start the program
2. Ask the user to enter any number.
3. Declare and initialize another variable reversed with 0, where reversed an integer
variable.
4. Get the last digit of the given number by performing the modulo division (%) and
store the value in last_digit variable, likey last_digit= number % 10.
5. Multiply reversed by 10 and add last_digit, like reversed = reversed*10 + last_digit.
6. Divide numbered by 10, like numbered/10.
7. Repeat the steps 3 to 5 till numbered is not equal to (or greater than) zero.
8. Stop the program
6. Write a C Program to Print the Odd and Even Series of a N Numbers
AIM:
Write a C Program to Print the Odd and Even Series of a N Numbers
ALGORITHM:
Step 1: Start
Step 2: [ Take Input ] Read: Number
Step 3: Check: If Number%2 == 0 Then
Print : N is an Even Number.
Else
Print : N is an Odd Number.
Step 4: Exit
7. PROGRAM:
RESULT:
Thus, a C Program for printing the odd and even series of a N numbers is completed
and run successfully
8. Write a C Program to get a string and convert the lowercase to uppercase and vice--versa
using getchar() and putchar().
AIM:
Write a C Program to get a string and convert the lowercase to uppercase and vice--
versa using getchar() and putchar().
ALGORITHM:
Step 1: Start the program
Step 2: Read char size of array str[15] and int i
Step 3: Specify the condition for while loop
Step 4: If string is capital
print str[i]+32
Else
Print s[i]-32
Step 5: increment the character i++
Step 6: print the string
Step 7: Exit the program
9. PROGRAM:
RESULT:
Thus, a C Program for getting a string and convert the lowercase to uppercase and vice--
versa using getchar() and putchar().s completed and run successfully
10. Write a C Program to input a string and find the number of each of the vowels appear in the
string.
AIM:
Write a C Program to input a string and find the number of each of the vowels appear in the
string.
ALGORITHM:
1. Start the program
2. set the count to 0
3. Loop through the string until it reaches a null character.
4. Compare each character to the vowels a, e, i o, and u.
5. If both are equal
6. Increase the count by one.
7. Print the count at the end.
8. Stop the program
11. RESULT:
Thus, a C Program for input a string and find the number of each of the vowels appear
in the string.is completed and run successfully
12. Write a C Program to Printing the reverse of a string
AIM:
Write a C Program to Printing the reverse of a string
ALGORITHM:
1. Start the program
2. Declare all the variables ( integer and character type )
3. Enter the string to be reversed
4. Find out the length of string
5. Swap the position of array element using loop
6. Store the swapped position
7. Print the reversed string as console output
8. Stop the program
13. PROGRAM:
RESULT:
Thus, a C Program for performing reversal of a string is completed and run
successfully
14. Write a C Program to accept N words and make it as a sentence by inserting blank spaces and a
full stop at the end.
AIM:
Write a C Program to accept N words and make it as a sentence by inserting blank spaces and a
full stop at the end.
ALGORITHM:
15. PROGRAM:
RESULT:
Thus, a C Program for accept N words and make it as a sentence by inserting blank
spaces and a full stop at the end is completed and run successfully