Uploaded by AKRITI NIGAM

C programming Lab Assignments

advertisement
1st Lab Assignment
29/11/2022
Introductory programs
2nd Lab Assignment 06/12/2022
1. WAP to check if the input number is even or odd.
2. WAP to take two numbers 'a' and 'b' as user input, create a menu driven program to find
i. a mod b
ii. Square root of a
iii. Decimal to binary conversion of b
iv. Represent 'a' as the closest power of 2
2. WAP to take an amount as user input and compute the denomination of notes/coins required
(minimum).
3. WAP to take length of triangle sides as input and check if the triangle is isosceles, scalene, or
equilateral
4. WAP to take marks in 5 subjects as user input and find the percentage and grade of the
student. Use following grading rule
Below 25 – F
25 to 45 – E
45 to 50 – D
50 to 60 – C
60 to 80 – B
Above 80 – A
3rd Lab Assignment 13/12/2022
1.
2.
3.
4.
WAP to Print ASCII Value of the Character
WAP to Display the Size of the Different Datatype (using sizeof ())
WAP to find if the input Character Is Vowel or Not
WAP to find the Sum of digits of an input number
While Loop
5. WAP to reverse a given Number
6. WAP to check if a number is palindrome
7. WAP to count number of digits in a given number
8. WAP to find LCM of Two input Numbers
4th Lab Assignment 20/12/2022
1. Print the following patterns as the output
1
1
1
1
1
*
*
*
*
i.
2
2
2
2
*
*
*
*
3
3
3
*
*
*
4
4 5
* *
*
iii.
*
*
* *
* * *
* * * *
*
*
*
*
*
1
2 3
4 5 6
7 8 9 10
v.
*
* *
* * *
* * * *
vii.
*
*
*
*
*
1
1
1
1
1
ii.
*
*
*
*
2
2
2
2
*
*
*
3
3
3
*
* *
4 5
4
iv.
1
1
1
1
1
2
3
4
vi.
1
1
3
6
1 5
10
* * * * * *
* * * * *
* * * *
* * *
*
1
4
10 5
* * *
* *
*
1
1
viii.
Download