model lab 2-set 1
model lab 2-set 1
model lab 2-set 1
size:·5
Elements:·1 2 3 4 5
Accessing·array·elements·using·pointer:1·2·3·4·5·⏎
Enter·two·integers:·16 9
Using·pointer·to·add:·25⏎
Using·pointer·to·subtract:·7⏎
Create a structure named Book to store book details like title, author, and price. Write a C
program to input details for three books, find the most expensive and the lowest priced books,
and display their information.
2. Get a number from the user and print factorial of a given number using recursive
functions
Write a C program to reverse a string without using library functions and using pointers.
Sample Input and Output:
Enter a string : Hindustan
Create a structure named "Employee" to store employee details such as employee ID, name,
and salary. Write a program to input data for three employees, find the highest salary employee,
and display their information.
3. Write a C program that uses typedef and takes input from the user to calculate the area
of a rectangle.
Write a program given an array, write a program to reverse it using pointers .
Write a program to find the GCD and LCM of two numbers using functions.
Input and Output Format:
Input consists of two integers corresponding to two values.
Output consists of two integers corresponding to GCD and LCM of the two numbers.
n1:·3
n2:·8
Sum:·11.00⏎
Product:·24.00
Write a recursive C program which computes the nth Fibonacci number for an
appropriate value of n.
9. Write a C program to demonstrate the usage of unions which manages two integer
values, x and y
Find the time taken to bake a cake for a cooking competition.Given the starting time and ending
time.
Print no.of.digits in a given number using recursive function
10. Write a C program that uses pre-processor directives to define and use constants, and it
takes input from the user to calculate the area of a circle.
Write a program to get the details of n students and to display their details, sorted in ascending
order based on marks
Print the maximum of n numbers using functions