Assignment 1
Conditional Statements
1. Write a C program using if-else to check whether a given number is divisible by both
3 and 5, only 3, only 5, or neither.
2. Write a C program to take marks of five subjects and calculate the percentage, then
display the grade using conditional statements.
3. Write a C program to find the largest among three numbers using nested if-else.
4. Write a C program that checks whether a given character is an uppercase letter,
lowercase letter, digit, or special symbol.
5. Write a C program to input the day number of a week (1–7) and print the
corresponding weekday name using if-else ladder.
Loops
1. Write a C program using a for loop to print all even numbers and calculate their sum
up to a given limit.
2. Write a C program using a while loop to find the reverse of a number.
3. Write a C program using a do-while loop to calculate the factorial of a number.
4. Write a C program to display the multiplication table of a given number using a for
loop.
5. Write a C program to calculate and print the sum of all digits of a given number using
while loop.
Arrays
1. Write a C program to find the maximum and minimum elements in an array.
2. Write a C program to calculate the average of all elements in an array.
3. Write a C program to find the position of a given element in an array (linear search).
4. Write a C program to copy all elements of one array into another array using a loop.
5. Write a C program to print the elements of an array in reverse order.
Functions
1. Write a C program using a function to calculate the square of a number.
2. Write a C program using a function to check whether a given number is even or odd.
3. Write a C program to find the factorial of a number using a user-defined function.
4. Write a C program to calculate the sum of digits of a number using a function.
5. Write a C program using a function to find the greatest of two numbers.