0% found this document useful (0 votes)
3 views

C Lab Manual

The document outlines a series of programming tasks and algorithms related to operators, expressions, decision making, looping, arrays, functions, and structures in C. It includes instructions for calculating areas, converting temperatures, calculating simple interest, and handling user input/output. Additionally, it covers decision-making programs, looping constructs, array manipulations, and the use of structures to manage data.

Uploaded by

tripod666999
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

C Lab Manual

The document outlines a series of programming tasks and algorithms related to operators, expressions, decision making, looping, arrays, functions, and structures in C. It includes instructions for calculating areas, converting temperatures, calculating simple interest, and handling user input/output. Additionally, it covers decision-making programs, looping constructs, array manipulations, and the use of structures to manage data.

Uploaded by

tripod666999
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

OPERATORS AND EXPRESSIONS

1. Write the algorithm and draw the flowchart to a) find area of a circle. b) find the area of a triangle.
2. Write the algorithm and draw the flowchart to convert temperature in Fahrenheit to centigrade using the
formula C=(F-32)5/9
3. Write the algorithm and draw the flowchart to calculate simple interest.
4. Write a program to calculate the electricity charges giving the following information:current reading,previous
reading,take the charge as 1.50 per unit.
5. Write a program to find swapping of two numbers.
6. Write a program to calculate roots of quadratic equation

Managing Input and Output Operators

1. Write a program to read a character from the user and display it.
2. Write a program that reads a character and prints its ASCII value.
3. Write a program to input your full name and age, then display it in a formatted manner
4. Write a program to print a floating-point number with two decimal places.

DECISION MAKING,BRANCHED STATEMENT

1. Write a program to find the largest of two numbers.


2. Write a program to to find largest of three numbers.
3. Write a program to find even or odd number.
4. Write a program to determine if the entered year is leap year or not
5. Write a program to determine if the entered character is vowel or consonant.
6. Write a program to read values of n and x and print the value of y using switch case where a. y=n+x when
n=1 b. y=1+x/n when n=2 c. y=n+3x when n=3 d. y=1+nx when n>3 or n

LOOPING

1. Write a program to find out the biggest of three numbers using nested if.
2. Write a program to print n-even numbers using a loop.
3. Write a program to print the sum of n-numbers.
4. Write a program for the Fibonacci Series.

ARRAY

1. Write a C program that declares a one-dimensional array of n elements, takes input from the user, and
calculates the sum and average of the elements.
2. Write a C program to add two 2x2 matrices. Initialize the matrices and display the result of their addition.
3. Write a C program that reads a 3x3 matrix from the user and prints its transpose. The transpose of a matrix is
obtained by swapping its rows and columns.
4. Write a C program to multiply two matrices, where each matrix can be of size m x n and n x p respectively.
The program should take the matrix dimensions and elements as input from the user and output the
resulting matrix.

FUNCTIONS

1. Write a C program to create a function that takes two integer parameters, adds them, and returns the sum.
The main function should call this function and display the result.
2. Write a C program to create a function that returns the square of a number. The main function should call
this function and display the result.
3. Write a C program that uses a recursive function to calculate the factorial of a number. The function should
return the factorial value to the main function, which will print the result.
4. Write a C program to create a function that takes three integer numbers and returns the largest one. The
main function should call this function and print the largest number
Structures
1. Write a C program to define a structure to store information about a book, including the title, author, and
price. Assign values to the members and print the information.
2. Write a C program to define a structure Employee with members id, name, and salary. Then, create an
array of 5 Employee structures and input the values for each employee. After that, print the details of
each employee.
3. Write a C program to define a structure Student which contains an array of 5 integers representing
marks of subjects. Accept the marks for each subject and calculate the total and average marks.

You might also like