Grind is a set of 100 C programs to finish, in order, before you touch LeetCode or DSA. Start from Program 1: warm-up first (output, variables, input), then moderate, then challenge. Wherever you see n, it is taken as user input.
cd ~/code/c/Grindtouch Level-1/3.cgedit Level-1/3.cgcc Level-1/3.c -o Level-1/3./Level-1/3git add .
git commit -m "3"
git push- Write a program to print "Hello, World!" on the screen.
- Write a program to read two numbers and print their sum.
- Write a program to read two numbers and print their sum, difference, product and quotient.
- Write a program to read the radius of a circle and print its area and circumference.
- Write a program to read the length and breadth of a rectangle and print its area and perimeter.
- Write a program to swap two numbers using a third variable.
- Write a program to swap two numbers without using a third variable.
- Write a program to read a temperature in Celsius and convert it to Fahrenheit.
- Write a program to read the marks of 5 subjects and print the total and average.
- Write a program to read seconds and convert them into hours, minutes and seconds.
- Write a program to read a number and check whether it is even or odd.
- Write a program to read a number and check whether it is positive, negative or zero.
- Write a program to read three numbers and find the largest among them.
- Write a program to read three numbers and find the smallest among them.
- Write a program to read a year and check whether it is a leap year or not.
- Write a program to read a character and check whether it is a vowel or a consonant.
- Write a program to read a character and check whether it is an alphabet, digit or special symbol.
- Write a program to read the marks of a student and print the grade (A/B/C/D/Fail).
- Write a program to read a number and check whether it is divisible by both 3 and 5.
- Write a program to read the age of a person and check whether they are eligible to vote.
- Write a program to display all the natural numbers from 1 to n. (n is user input)
- Write a program to display all natural numbers from 1 to n in reverse order.
- Write a program to display all even numbers from 1 to n.
- Write a program to display all odd numbers from 1 to n.
- Write a program to find the sum of all natural numbers from 1 to n.
- Write a program to find the sum of all even numbers from 1 to n.
- Write a program to find the sum of all odd numbers from 1 to n.
- Write a program to find the product of all natural numbers from 1 to n (factorial of n).
- Write a program to display the multiplication table of a number n.
- Write a program to display all multiples of a number m up to n terms.
- Write a program to count how many numbers from 1 to n are divisible by 3.
- Write a program to display all numbers from 1 to n that are divisible by 3 or 5.
- Write a program to count the number of digits in a number n.
- Write a program to display all the digits of a number n (one per line).
- Write a program to find the sum of all digits of a number n.
- Write a program to find the product of all digits of a number n.
- Write a program to reverse a number n.
- Write a program to find the largest digit in a number n.
- Write a program to find the smallest digit in a number n.
- Write a program to count the number of even digits and odd digits in a number n.
- Write a program to check whether a number n is a palindrome (reads the same reversed).
- Write a program to replace all zeros in a number n with the digit 5.
- Write a program to find the sum of the first and last digit of a number n.
- Write a program to read a number and check whether it is prime or not.
- Write a program to display all prime numbers from 1 to n.
- Write a program to display the first n prime numbers.
- Write a program to check whether a number is an Armstrong number.
- Write a program to display all Armstrong numbers from 1 to n.
- Write a program to check whether a number is a perfect number.
- Write a program to check whether a number is a strong number (sum of factorials of its digits).
- Write a program to check whether a number is an automorphic number.
- Write a program to check whether a number is a Harshad (Niven) number.
- Write a program to find all factors (divisors) of a number n.
- Write a program to count the number of factors of a number n.
- Write a program to find the GCD (HCF) of two numbers.
- Write a program to find the LCM of two numbers.
- Write a program to display the first n terms of the Fibonacci series.
- Write a program to find the sum of the first n terms of the Fibonacci series.
- Write a program to find the sum of the series 1 + 2 + 3 + ... + n.
- Write a program to find the sum of the series 1^2 + 2^2 + 3^2 + ... + n^2.
- Write a program to find the sum of the series 1 + 1/2 + 1/3 + ... + 1/n.
- Write a program to find the value of x raised to the power y without using inbuilt power.
- Write a program to print a right-angled triangle pattern of stars of height n.
- Write a program to print an inverted right-angled triangle pattern of stars of height n.
- Write a program to print a pyramid pattern of stars of height n.
- Write a program to print a number triangle (row i contains numbers 1 to i).
- Write a program to print Pascal's triangle for n rows.
- Write a program to find the length of a string without using an inbuilt function.
- Write a program to count the number of vowels and consonants in a string.
- Write a program to count the number of words in a sentence.
- Write a program to reverse a string.
- Write a program to check whether a string is a palindrome.
- Write a program to convert a string to uppercase and lowercase without inbuilt case functions.
- Write a program to count the frequency of each character in a string.
- Write a program to remove all spaces from a string.
- Write a program to check whether two strings are anagrams of each other.
- Write a program to find the first non-repeating character in a string.
- Write a program to replace all occurrences of a character with another character in a string.
- Write a program to toggle the case of each character in a string.
- Write a program to read n elements into an array and print them.
- Write a program to find the sum and average of all elements in an array.
- Write a program to find the largest and smallest element in an array.
- Write a program to count the number of even and odd elements in an array.
- Write a program to search for an element in an array (linear search).
- Write a program to reverse the elements of an array.
- Write a program to find the second largest element in an array.
- Write a program to count the frequency of each element in an array.
- Write a program to remove duplicate elements from an array.
- Write a program to sort an array in ascending order (bubble sort).
- Write a program to merge two arrays into one.
- Write a program to find the sum of all even-indexed and odd-indexed elements separately.
- Write a program to check whether a number is prime, using a function/method.
- Write a program to print all prime numbers between two given numbers a and b.
- Write a program to find the sum of digits of a number repeatedly until a single digit remains.
- Write a program to count the number of prime digits present in a number n.
- Write a program to check whether a number is a palindrome and a prime at the same time.
- Write a program to find the largest and smallest number that can be formed using the digits of n.
- Write a program to convert a decimal number into its binary equivalent.
- Write a program to convert a binary number into its decimal equivalent.
- Write a program to display a menu that lets the user repeatedly choose any of the above tasks until they choose to exit.
Built by Drishtant Ghosh (Drix10) · AI systems engineer and 1x acquired founder, Bengaluru
Portfolio · LinkedIn · X · Blog · All projects
More from Drix10: Agent Flow (guardrails for AI coding agents) · MiroHedge (AI-assisted systematic fund) · Guardian (UPI scam interceptor) · Sentinel (AI security CLI) · Keystroke-LLM (NumPy transformer on a keyboard) · AI Resources (daily AI knowledge base)