Tutorial sheet
Course : Algorithm and Programming
1. Hello World Program
Write a C program to print "Hello, World!" to the screen.
2. Sum of Two Numbers
Write a C program that takes two numbers as input from the user and prints their sum.
3. Check Odd or Even
Write a C program that takes a number as input and checks if it's odd or even.
4. Find the Largest of Two Numbers
Write a C program that takes two numbers as input and prints the largest number.
5. Find the Largest of Three Numbers
Write a C program that takes three numbers as input and prints the largest number.
6. Factorial of a Number
Write a C program to calculate the factorial of a given number (use both iterative and recursive
methods).
7. Fibonacci Series
Write a C program that prints the Fibonacci series up to a given number.
8. Prime Number Check
Write a C program that checks if a number is prime or not.
9. Palindrome Check
Write a C program to check whether a given string or number is a palindrome.
10. Reverse a Number
Write a C program to reverse a given number.
11. Count Vowels and Consonants in a String
Write a C program that takes a string as input and counts the number of vowels and consonants.
12. Find the Sum of Digits of a Number
Write a C program that calculates the sum of digits of a given number.
13. Array Sum and Average
Write a C program that takes an array of integers and calculates their sum and average.
14. Find the Largest Element in an Array
Write a C program to find the largest element in an array of integers.
15. Sort an Array in Ascending Order
Write a C program to sort an array of integers in ascending order using the Bubble Sort algorithm.
16. Linear Search
Write a C program to search for a specific number in an array using Linear Search.
17. Count the Number of Words in a String
Write a C program that counts the number of words in a given string.
18. Matrix Addition
Write a C program that takes two 2D arrays (matrices) as input and adds them together.
19. Transpose of a Matrix
Write a C program that finds the transpose of a given 2D matrix.
20. Multiplication Table of a Number
Write a C program that takes a number as input and prints its multiplication table.