SlideShare a Scribd company logo
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
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.
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
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
PROGRAM:
RESULT:
Thus, a C Program for performing reversal of a number is completed and run
successfully
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
PROGRAM:
RESULT:
Thus, a C Program for printing the odd and even series of a N numbers is completed
and run successfully
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
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
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
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
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
PROGRAM:
RESULT:
Thus, a C Program for performing reversal of a string is completed and run
successfully
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:
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

More Related Content

Similar to C_Lab Manual_Part A.docx

c programing
c programingc programing
c programing
bibek lamichhane
 
Cp manual final
Cp manual finalCp manual final
Cp manual final
itprasad1237
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
Abir Hossain
 
Programming Practice Questions_C
Programming Practice Questions_CProgramming Practice Questions_C
Programming Practice Questions_C
Deep Prajapati Microplacer
 
best notes in c language
best notes in c languagebest notes in c language
best notes in c language
India
 
Mmt 001
Mmt 001Mmt 001
Mmt 001
sujatam8
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
Drjilesh
 
C activities
C activitiesC activities
C activities
Shujaat Abbas
 
Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docx
tiffanyd4
 
I PUC CS Lab_programs
I PUC CS Lab_programsI PUC CS Lab_programs
I PUC CS Lab_programs
Prof. Dr. K. Adisesha
 
Java programlist (1)
Java programlist (1)Java programlist (1)
Java programlist (1)
Aditya Aggarwal
 
CS291(C Programming) assignment
CS291(C Programming) assignmentCS291(C Programming) assignment
CS291(C Programming) assignment
Kuntal Bhowmick
 
Programming questions
Programming questionsProgramming questions
Programming questions
Dr.Subha Krishna
 
Unit-IV.pptx
Unit-IV.pptxUnit-IV.pptx
Unit-IV.pptx
Mehul Desai
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structures
Micheal Ogundero
 
C and Data structure lab manual ECE (2).pdf
C and Data structure lab manual ECE (2).pdfC and Data structure lab manual ECE (2).pdf
C and Data structure lab manual ECE (2).pdf
janakim15
 
C Programming
C ProgrammingC Programming
C Programming
Rumman Ansari
 
C programming language
C programming languageC programming language
C programming language
Abin Rimal
 
Programming in C Lab
Programming in C LabProgramming in C Lab
Programming in C Lab
Neil Mathew
 

Similar to C_Lab Manual_Part A.docx (20)

c programing
c programingc programing
c programing
 
Cp manual final
Cp manual finalCp manual final
Cp manual final
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
 
Programming Practice Questions_C
Programming Practice Questions_CProgramming Practice Questions_C
Programming Practice Questions_C
 
best notes in c language
best notes in c languagebest notes in c language
best notes in c language
 
Mmt 001
Mmt 001Mmt 001
Mmt 001
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
 
C programming
C programmingC programming
C programming
 
C activities
C activitiesC activities
C activities
 
Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docx
 
I PUC CS Lab_programs
I PUC CS Lab_programsI PUC CS Lab_programs
I PUC CS Lab_programs
 
Java programlist (1)
Java programlist (1)Java programlist (1)
Java programlist (1)
 
CS291(C Programming) assignment
CS291(C Programming) assignmentCS291(C Programming) assignment
CS291(C Programming) assignment
 
Programming questions
Programming questionsProgramming questions
Programming questions
 
Unit-IV.pptx
Unit-IV.pptxUnit-IV.pptx
Unit-IV.pptx
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structures
 
C and Data structure lab manual ECE (2).pdf
C and Data structure lab manual ECE (2).pdfC and Data structure lab manual ECE (2).pdf
C and Data structure lab manual ECE (2).pdf
 
C Programming
C ProgrammingC Programming
C Programming
 
C programming language
C programming languageC programming language
C programming language
 
Programming in C Lab
Programming in C LabProgramming in C Lab
Programming in C Lab
 

More from Pandiya Rajan

CICD.pptx
CICD.pptxCICD.pptx
CICD.pptx
Pandiya Rajan
 
HTML-Advance.pptx
HTML-Advance.pptxHTML-Advance.pptx
HTML-Advance.pptx
Pandiya Rajan
 
css1.pptx
css1.pptxcss1.pptx
css1.pptx
Pandiya Rajan
 
HTML-Basic.pptx
HTML-Basic.pptxHTML-Basic.pptx
HTML-Basic.pptx
Pandiya Rajan
 
UNIT-I Introduction to CICD.pptx
UNIT-I Introduction to CICD.pptxUNIT-I Introduction to CICD.pptx
UNIT-I Introduction to CICD.pptx
Pandiya Rajan
 
UNIT-I Introduction to Ansible.pptx
UNIT-I Introduction to Ansible.pptxUNIT-I Introduction to Ansible.pptx
UNIT-I Introduction to Ansible.pptx
Pandiya Rajan
 
UNIT-I Introduction to CICD.pptx
UNIT-I Introduction to CICD.pptxUNIT-I Introduction to CICD.pptx
UNIT-I Introduction to CICD.pptx
Pandiya Rajan
 
page_fault pbm.ppt
page_fault pbm.pptpage_fault pbm.ppt
page_fault pbm.ppt
Pandiya Rajan
 
process syn.ppt
process syn.pptprocess syn.ppt
process syn.ppt
Pandiya Rajan
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
Pandiya Rajan
 
selinuxbasicusage.pptx
selinuxbasicusage.pptxselinuxbasicusage.pptx
selinuxbasicusage.pptx
Pandiya Rajan
 
lvm.pptx
lvm.pptxlvm.pptx
lvm.pptx
Pandiya Rajan
 
SSH.ppt
SSH.pptSSH.ppt
SSH.ppt
Pandiya Rajan
 
environmentalpollution-.pptx
environmentalpollution-.pptxenvironmentalpollution-.pptx
environmentalpollution-.pptx
Pandiya Rajan
 
DM.pptx
DM.pptxDM.pptx
DM.pptx
Pandiya Rajan
 
thermal pollution.pptx
thermal pollution.pptxthermal pollution.pptx
thermal pollution.pptx
Pandiya Rajan
 
marinepollution.pptx
marinepollution.pptxmarinepollution.pptx
marinepollution.pptx
Pandiya Rajan
 
logical volume manager.ppt
logical volume manager.pptlogical volume manager.ppt
logical volume manager.ppt
Pandiya Rajan
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
Pandiya Rajan
 
c-c++-java-python programs.docx
c-c++-java-python programs.docxc-c++-java-python programs.docx
c-c++-java-python programs.docx
Pandiya Rajan
 

More from Pandiya Rajan (20)

CICD.pptx
CICD.pptxCICD.pptx
CICD.pptx
 
HTML-Advance.pptx
HTML-Advance.pptxHTML-Advance.pptx
HTML-Advance.pptx
 
css1.pptx
css1.pptxcss1.pptx
css1.pptx
 
HTML-Basic.pptx
HTML-Basic.pptxHTML-Basic.pptx
HTML-Basic.pptx
 
UNIT-I Introduction to CICD.pptx
UNIT-I Introduction to CICD.pptxUNIT-I Introduction to CICD.pptx
UNIT-I Introduction to CICD.pptx
 
UNIT-I Introduction to Ansible.pptx
UNIT-I Introduction to Ansible.pptxUNIT-I Introduction to Ansible.pptx
UNIT-I Introduction to Ansible.pptx
 
UNIT-I Introduction to CICD.pptx
UNIT-I Introduction to CICD.pptxUNIT-I Introduction to CICD.pptx
UNIT-I Introduction to CICD.pptx
 
page_fault pbm.ppt
page_fault pbm.pptpage_fault pbm.ppt
page_fault pbm.ppt
 
process syn.ppt
process syn.pptprocess syn.ppt
process syn.ppt
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
selinuxbasicusage.pptx
selinuxbasicusage.pptxselinuxbasicusage.pptx
selinuxbasicusage.pptx
 
lvm.pptx
lvm.pptxlvm.pptx
lvm.pptx
 
SSH.ppt
SSH.pptSSH.ppt
SSH.ppt
 
environmentalpollution-.pptx
environmentalpollution-.pptxenvironmentalpollution-.pptx
environmentalpollution-.pptx
 
DM.pptx
DM.pptxDM.pptx
DM.pptx
 
thermal pollution.pptx
thermal pollution.pptxthermal pollution.pptx
thermal pollution.pptx
 
marinepollution.pptx
marinepollution.pptxmarinepollution.pptx
marinepollution.pptx
 
logical volume manager.ppt
logical volume manager.pptlogical volume manager.ppt
logical volume manager.ppt
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 
c-c++-java-python programs.docx
c-c++-java-python programs.docxc-c++-java-python programs.docx
c-c++-java-python programs.docx
 

Recently uploaded

Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 

Recently uploaded (20)

Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 

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
  • 5. PROGRAM: RESULT: Thus, a C Program for performing reversal of a number is completed and run successfully
  • 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