This repository contains a collection of fundamental C programming exercises focused on loops, mathematical series, and number manipulation. These problems are excellent for practicing logic, problem-solving, and algorithmic thinking in C.
- Compiler: GCC (GNU Compiler Collection)
- Code Editor: Visual Studio Code (VS Code) with the C/C++ extension is highly recommended for writing and debugging these programs.
- Take a number
nfrom the keyboard. Print the numbers from0ton. - Take a number
nfrom the keyboard. Print the even numbers from2ton. - Take a number
nfrom the keyboard. Print the odd numbers from1ton. - Take a number
nfrom the keyboard. Print the numbers from0tonwhich are a multiple of another number,x. (For example, ifn=10andx=2, then the output numbers are0, 2, 4, 6, 8, and10). - Take an integer number from the keyboard. Print its multiplication table.
- Input the value of
n. Then solve the following series:1 + 3 + 5 + …… + (2n-1) - Input the value of
n. Then solve the following series:2 + 4 + 6 + …… + 2n - Input the value of
n. Then solve the following series:12+ 32+ 52+ …… + (2n-1)2 - Input the value of
n. Then solve the following series:22+ 42+ 62+ …… + (2n)2 - Input the value of
n. Then solve the following series:1 + 1/2 + 1/3 + …… + 1/n - Input the value of
n. Then solve the following series:1 + 1/22+ 1/32+ …… + 1/n2 - Input the value of
n. Then solve the following series:1 + 1/3 + 1/5 + …… + 1/(2n-1) - Input the value of
n. Then solve the following series:1/22+ 1/42+ 1/62+ …… + 1/(2n)2
- Find the factorial of a given number,
n. - Find the sum of all constituent digit(s) of a taken integer number from the keyboard.
- The numbers in the sequence
1, 1, 2, 3, 5, 8, 13, 21……are called Fibonacci numbers. Use a loop structure to calculate and print the firstmFibonacci numbers. - Write a C program to count the number of digits in a number.
- Write a C program to find the first and last digit of a number.
- Write a C program to find the sum of the first and last digit of a number.
- Write a C program to calculate the sum of digits of a number.
- Write a C program to calculate the product of digits of a number.
- Write a C program to enter a number and print its reverse.
- Write a C program to check whether a number is a palindrome or not.
- Write a C program to find the power of a number using a loop.
- Write a C program to check whether a number is a Prime number or not.
- Write a C program to check whether a number is an Armstrong number or not.
Happy Coding!