- 🚀🔥 100+ C Programming Challenges 💯 for Beginners (2024)
- 🚀🔥 C Complete Course Single Shot with Certification
- Completion Certificate
- Show the following patterns just using print statements:
- Show the following patterns using single print statement:
- Create a program to input name of the person and respond with ”Welcome NAME to KG Coding”
- Create a program to declare two integer variables, assign them values, and display their values.
- Create a program that declares one variable of each of the fundamental data types (int, float, double, char) and prints their size using sizeof() operator.
- Define variables for storing a user's first name, last name, and age using appropriate naming conventions and then display them.
- Create a program to print the area of a square by inputting its side length.
- Create a program to define a constant for the mathematical value pi (3.14159) and use it to calculate and print the circumference of a circle with a radius input from user.
- Create a program to print the area of a circle by inputting its radius.
- Create a program to swap two numbers.
- Create a program that takes two numbers and shows result of all arithmetic operators (+,-,*,/,%).
- Given an integer value, convert it to a floating-point value and print both.
- Create a program to calculate product of two floating points numbers.
- Create a program to calculate Perimeter of a rectangle.
- Perimeter of rectangle ABCD = A+B+C+D
- Create a program to calculate the Area of a Triangle.
- Area of triangle = ½BH
- Create a program to calculate simple interest.
- Simple Interest = (P x T x R)/100
- Create a program to calculate Compound interest.
- Compound Interest = P(1 + R/100)t
- Create a program to convert Fahrenheit to Celsius
- °C = (°F - 32) × 5/9
- Create a program that determines if a number is positive, negative, or zero.
- Create a program that determines if a number is odd or even.
- Create a program that determines the greatest of the three numbers.
- Create a program that determines if a given year is a leap year (considering conditions like divisible by 4 but not 100, unless also divisible by 400).
- Create a program that calculates grades based on marks
- A -> above 90%
- B -> above 75%
- C -> above 60%
- D -> above 30%
- F -> below 30%
- Create a program that categorize a person into different age groups:
- Child -> below 13
- Teen -> below 20
- Adult -> below 60
- Senior-> above 60
- Create a program to find the minimum of two numbers using ternary operator.
- Create a program to find if the given number is even or odd using ternary operator.
- Create a program to calculate the absolute value of a given integer using ternary operator.
- Create a program to Based on a student's score, categorize as "High", "Moderate", or "Low" using the ternary operator (e.g., High for scores > 80, Moderate for 50-80, Low for < 50).
- Create a program to print the month of the year based on a number (1-12) input by the user.
- Create a program to create a simple calculator that uses a switch statement to perform basic arithmetic operations like addition, subtraction, multiplication, and division.
- Develop a program that prints the multiplication table for a given number.
- Create a program to sum all odd numbers from 1 to a specified number N.
- Write a function that calculates the factorial of a given number.
- Create a program that computes the sum of the digits of an integer.
- Create a program to find the Least Common Multiple (LCM) of two numbers.
- Create a program to find the Greatest Common Divisor (GCD) of two integers.
- Create a program to check whether a given number is prime using while.
- Create a program to reverse the digits of a number.
- Create a program to print the Fibonacci series up to a certain number.
- Create a program to check if a number is an Armstrong number.
- Create a program to verify if a number is a palindrome.
- Create a program that print patterns:
- Create a program that prompts the user to enter a positive number. Use a do-while loop to keep asking for the number until the user enters a valid positive number.
- Develop a program that calculates the sum of all numbers entered by a user until the user enters 0. The total sum should then be displayed.
- Create a program using for loop multiplication table for a number.
- Create a program using for to display if a number is prime or not.
- Create a program using continue to sum all positive numbers entered by the user; skip any negative numbers.
- Create a program using continue to print only even numbers using continue for odd numbers.
- Write a program that continuously reads integers from the user and prints their squares. Use an infinite loop and a break statement to exit when a special number (e.g., -1) is entered.
- Write a function named greet that prints "Hello, World!" when called.
- Write a function that adds that takes 4 int parameters and returns the sum.
- Define a function square that takes an int and returns its square.
- Call a function print_date that prints the current date. Define the function without any parameters.
- Create a function max that takes two float arguments and returns the larger value.
- Demonstrate with a function increment that the original integer passed to it does not change after incrementing it inside the function.
- Call a function get_average that takes five int numbers and returns the average.
- Create a program using recursion to display the Fibonacci series upto a certain number.
- Create a program using recursion to check if a number is a palindrome using recursion.
- Write a program that declares an integer variable and a pointer to it. Assign a value and print it using the pointer.
- Write a program to change the value of an integer variable using a pointer and the * operator.
- Declare a pointer to a char and use it to read and print a character entered by the user.
- Implement a void minmax(int *a, int *b, int *min, int *max) function that takes two integer pointers a and b as input and assigns the smaller value to min and the larger value to max using call by reference. Write a main function to test it with different values.
- Create a program that converts a large number of kilometers to miles, using long or long long to store the distance.
- Write a program to demonstrate the difference in range between long and long long by calculating the factorial of 20.
- Write a C program that initializes an unsigned int to its maximum possible value and an int to a negative number. Add 1 to both, and print the results to show how the unsigned int wraps around to 0, whereas the int remains negative due to overflow
- Create a program to find the sum and average of all elements in an array.
- Create a program to find number of occurrences of an element in an array.
- Create a program to find the maximum and minimum element in an array.
- Create a program to check if the given array is sorted.
- Create a program to return a new array deleting a specific element.
- Create a program to reverse an array.
- Create a program to check is the array is palindrome or not.
- Write a function that uses pointer arithmetic to copy an array of char into another.
- Create a program to merge two sorted arrays.
- Create a program to search an element in a 2-D array.
- Create a program to do sum and average of all elements in a 2-array.
- Create a program to find the sum of two diagonal elements.
- Read a line of text from the user using fgets and then print it using puts.
- Use printf with format specifiers to format and print a date string (day, month, year).
- Write a program to convert a input string to uppercase.
- Create a simple text-based user login system that compares a stored password string using strcmp.
- Use a 2-D character array to store and display a tic-tac-toe board.
- Write a function that takes a string and reverses it in place.
- Implement a trim function that removes leading and trailing spaces from a string.
- Create a program that checks if a given string is a palindrome (the same forwards and backwards) and outputs the result.
- Create a program using do-while to find password checker until a valid password is entered.
- Create a program using break to read inputs from the user in a loop and break the loop if a specific keyword (like "exit") is entered.
- Create a program where you need to store and process data for a Book with attributes like title, author, and price, demonstrating why a structure is more suitable than separate variables.
- Initialize an array of Book structures with different data for each book using designated initializers.
- Define a Car structure with fields for make, model, year, and color.
- Pass a Car structure to a function that prints out a description of the car in one complete sentence.
- Write a function that accepts a pointer to a Student structure with fields for id, name, year, gpa and modifies its grades.
- Write a function where the Student structure also has books they have borrowed inside, showing nested structure usage.
- Create a program that dynamically allocates memory for a Car structure and then free it at the end of the program.
- Create a program that uses malloc to dynamically allocate an array for a specified number of float values entered by the user and then stores user-entered numbers into it.
- Use calloc to allocate an array for a set of char characters representing a sentence, ensuring all the memory is initialized to zero.
- Allocate memory for a struct representing a Point with x and y coordinates, set some values, and then properly deallocate the memory using free.
- Create an array using calloc and fill it with random numbers, then use realloc to shrink the array size by half and print the remaining numbers.
- Write a program that asks the user for a filename, attempts to open it, and reports whether the operation was successful or not.
- Create a program that reads integers from a file and calculates their sum.
- Write a program that copies one text file's contents to another, stopping when it reaches EOF of the source file.
- Write a program that takes user input and writes it to a file, ensuring each entry is on a new line.
- Develop a program that appends user input to the end of a log file each time it's run.
- Create a program that performs both reading and writing operations on a file called data.txt