1 Echo Number: Ask the user for their favorite whole number using scanf("%d", &num) and print: "Your lucky number is [num]!"
2 Age Calculator: Input the current year and the user's birth year as integers, calculate their age by subtraction, and print the result.
3 Simple Two-Number Math: Read two integers and . Print their sum, difference, product, and integer quotient.
4 Remainder Finder: Read two integers and use the modulus operator % to display the remainder when the first is divided by the second.
5 Rectangle Perimeter: Input the length and width of a room as integers; compute and display the perimeter ().
2026-09-14 18:28
6. Temperature Converter: Take a temperature in Celsius as a float or double and convert it to Fahrenheit using $F = (C \times 9.0 / 5.0) + 32.0$. Print the result formatted to 2 decimal places (%.2f).
7. Discount Calculator: Input an item's original price (float) and a percentage discount (float). Calculate the savings and the final price to pay.
8. Circle Area & Circumference: Prompt for the radius as a decimal number. Define PI as 3.14159 and calculate both area ($\pi r^2$) and circumference ($2 \pi r$).
9. Average of Three Exam Scores: Prompt for three separate marks (decimals), calculate their average, and display it rounded to 1 decimal place.
10. Currency Conversion: Input an amount in Indian Rupees (INR) as a float, multiply it by an exchange rate (e.g., USD conversion rate), and print the foreign currency value.
11. Single Letter Echo: Ask the user to type a single character using scanf(" %c", &ch) and print: "You pressed key: [ch]".
12. Secret Code (ASCII Value): Read a single letter and print both the character and its numeric ASCII code (printf("%c has ASCII value %d", ch, ch)).
13. Next Letter in Line: Take a character input and print the next character in the alphabet simply by adding 1 (ch + 1).
14. Simple Upper-to-Lower: Read a capital letter and convert it to lowercase by adding 32 to its ASCII value (or using tolower()).
15. Grade Inspector: Take a single letter grade ('A', 'B', 'C') and print a custom encouraging message based on the letter.
2026-09-14 18:31
16. Friendly Greeting: Declare a character array char name[50];, ask for the user's first name, and print "Welcome to C programming, [name]!"
17. Name Length Counter: Read a one-word name and count how many characters it contains using strlen() from <string.h> (or a simple loop until '\0').
18. Personalized ID Badge: Take a first name (string), age (int), and blood group letter (char), then print a neatly aligned 3-line ID card badge.
19. Grocery Bill Generator: Prompt for an item's name (string), quantity (int), and price per unit (float). Multiply to get the total and format a mini receipt.
20. Mini Mad-Libs Game: Ask for a friend's name (string), an animal (string), a lucky number (int), and a favorite decimal number (float). Assemble them into a funny 3-sentence story.
2026-09-14 18:34
1. Echo Number
C
#include <stdio.h>
int main() {
int num;
printf("Enter your favorite whole number: ");
scanf("%d", &num);
printf("Your lucky number is %d!\n", num);
return 0;
}
2. Age Calculator
C
#include <stdio.h>
int main() {
int current_year, birth_year;
printf("Enter current year: ");
scanf("%d", ¤t_year);
printf("Enter your birth year: ");
scanf("%d", &birth_year);
int age = current_year - birth_year;
printf("You are %d years old.\n", age);
return 0;
}
3. Simple Two-Number Math
C
#include <stdio.h>
int main() {
int a, b;
printf("Enter two integers: ");
scanf("%d %d", &a, &b);
printf("Sum: %d\n", a + b);
printf("Difference: %d\n", a - b);
printf("Product: %d\n", a * b);
printf("Quotient: %d\n", a / b);
return 0;
}
4. Remainder Finder
C
#include <stdio.h>
int main() {
int num1, num2;
printf("Enter two integers: ");
scanf("%d %d", &num1, &num2);
int remainder = num1 % num2;
printf("The remainder when %d is divided by %d is: %d\n", num1, num2, remainder);
return 0;
}
5. Rectangle Perimeter
C
#include <stdio.h>
int main() {
int length, width;
printf("Enter length and width of the room: ");
scanf("%d %d", &length, &width);
int perimeter = 2 * (length + width);
printf("The perimeter of the room is: %d\n", perimeter);
return 0;
}
Part 2: Floating-Point Math (float, %.2f, %.1f)
6. Temperature Converter
C
#include <stdio.h>
int main() {
float celsius;
printf("Enter temperature in Celsius: ");
scanf("%f", &celsius);
float fahrenheit = (celsius * 9.0 / 5.0) + 32.0;
printf("%.2f C = %.2f F\n", celsius, fahrenheit);
return 0;
}
#include <stdio.h>
int main() {
float inr;
const float INR_TO_USD = 0.012; // Example exchange rate
printf("Enter amount in Indian Rupees (INR): ");
scanf("%f", &inr);
float usd = inr * INR_TO_USD;
printf("%.2f INR is approximately $%.2f USD\n", inr, usd);
return 0;
}
Part 3: Characters & ASCII Values (char, %c)
11. Single Letter Echo
C
#include <stdio.h>
int main() {
char ch;
printf("Type a single character: ");
// Note the space before %c to skip any lingering newline
scanf(" %c", &ch);
printf("You pressed key: %c\n", ch);
return 0;
}
12. Secret Code (ASCII Value)
C
#include <stdio.h>
int main() {
char ch;
printf("Enter a single letter: ");
scanf(" %c", &ch);
printf("%c has ASCII value %d\n", ch, ch);
return 0;
}
13. Next Letter in Line
C
#include <stdio.h>
int main() {
char ch;
printf("Enter a letter: ");
scanf(" %c", &ch);
char next = ch + 1;
printf("The next character is: %c\n", next);
return 0;
}
14. Simple Upper-to-Lower
C
#include <stdio.h>
int main() {
char upper;
printf("Enter a capital letter: ");
scanf(" %c", &upper);
// Adding 32 converts uppercase ASCII to lowercase
char lower = upper + 32;
printf("Lowercase: %c\n", lower);
return 0;
}
15. Grade Inspector
C
#include <stdio.h>
int main() {
char grade;
printf("Enter your grade (A, B, or C): ");
scanf(" %c", &grade);
if (grade == 'A' || grade == 'a') {
printf("Outstanding work! Keep shining!\n");
} else if (grade == 'B' || grade == 'b') {
printf("Great job! You are doing very well!\n");
} else if (grade == 'C' || grade == 'c') {
printf("Good effort! Keep practicing and you will grow!\n");
} else {
printf("Keep working hard and learning!\n");
}
return 0;
}
Part 4: Strings & Mixed Mini-Projects (char[], %s, mixed types)
16. Friendly Greeting
C
#include <stdio.h>
int main() {
char name[50];
printf("Enter your first name: ");
scanf("%s", name);
printf("Welcome to C programming, %s!\n", name);
return 0;
}
17. Name Length Counter
C
#include <stdio.h>
#include <string.h>
int main() {
char name[50];
printf("Enter a one-word name: ");
scanf("%s", name);
int length = strlen(name);
printf("The name \"%s\" has %d characters.\n", name, length);
return 0;
}
18. Personalized ID Badge
C
#include <stdio.h>
int main() {
char name[50];
int age;
char blood_group;
printf("Enter first name: ");
scanf("%s", name);
printf("Enter age: ");
scanf("%d", &age);
printf("Enter blood group letter (e.g. O, A, B): ");
scanf(" %c", &blood_group);
printf("\n=============================\n");
printf(" NAME : %s\n", name);
printf(" AGE : %d\n", age);
printf(" BLOOD GROUP : %c+\n", blood_group);
printf("=============================\n");
return 0;
}
1 Echo Number: Ask the user for their favorite whole number using
scanf("%d", &num)and print:"Your lucky number is [num]!"2 Age Calculator: Input the current year and the user's birth year as integers, calculate their age by subtraction, and print the result.
3 Simple Two-Number Math: Read two integers and . Print their sum, difference, product, and integer quotient.
4 Remainder Finder: Read two integers and use the modulus operator
%to display the remainder when the first is divided by the second.5 Rectangle Perimeter: Input the length and width of a room as integers; compute and display the perimeter ().
6. Temperature Converter: Take a temperature in Celsius as a
floatordoubleand convert it to Fahrenheit using $F = (C \times 9.0 / 5.0) + 32.0$. Print the result formatted to 2 decimal places (%.2f).7. Discount Calculator: Input an item's original price (
float) and a percentage discount (float). Calculate the savings and the final price to pay.8. Circle Area & Circumference: Prompt for the radius as a decimal number. Define
PIas3.14159and calculate both area ($\pi r^2$) and circumference ($2 \pi r$).9. Average of Three Exam Scores: Prompt for three separate marks (decimals), calculate their average, and display it rounded to 1 decimal place.
10. Currency Conversion: Input an amount in Indian Rupees (INR) as a
float, multiply it by an exchange rate (e.g., USD conversion rate), and print the foreign currency value.11. Single Letter Echo: Ask the user to type a single character using
scanf(" %c", &ch)and print:"You pressed key: [ch]".12. Secret Code (ASCII Value): Read a single letter and print both the character and its numeric ASCII code (
printf("%c has ASCII value %d", ch, ch)).13. Next Letter in Line: Take a character input and print the next character in the alphabet simply by adding 1 (
ch + 1).14. Simple Upper-to-Lower: Read a capital letter and convert it to lowercase by adding 32 to its ASCII value (or using
tolower()).15. Grade Inspector: Take a single letter grade (
'A','B','C') and print a custom encouraging message based on the letter.16. Friendly Greeting: Declare a character array
char name[50];, ask for the user's first name, and print"Welcome to C programming, [name]!"17. Name Length Counter: Read a one-word name and count how many characters it contains using
strlen()from<string.h>(or a simple loop until'\0').18. Personalized ID Badge: Take a first name (
string), age (int), and blood group letter (char), then print a neatly aligned 3-line ID card badge.19. Grocery Bill Generator: Prompt for an item's name (
string), quantity (int), and price per unit (float). Multiply to get the total and format a mini receipt.20. Mini Mad-Libs Game: Ask for a friend's name (
string), an animal (string), a lucky number (int), and a favorite decimal number (float). Assemble them into a funny 3-sentence story.1. Echo Number
C
#include <stdio.h> int main() { int num; printf("Enter your favorite whole number: "); scanf("%d", &num); printf("Your lucky number is %d!\n", num); return 0; }2. Age Calculator
C
#include <stdio.h> int main() { int current_year, birth_year; printf("Enter current year: "); scanf("%d", ¤t_year); printf("Enter your birth year: "); scanf("%d", &birth_year); int age = current_year - birth_year; printf("You are %d years old.\n", age); return 0; }3. Simple Two-Number Math
C
#include <stdio.h> int main() { int a, b; printf("Enter two integers: "); scanf("%d %d", &a, &b); printf("Sum: %d\n", a + b); printf("Difference: %d\n", a - b); printf("Product: %d\n", a * b); printf("Quotient: %d\n", a / b); return 0; }4. Remainder Finder
C
#include <stdio.h> int main() { int num1, num2; printf("Enter two integers: "); scanf("%d %d", &num1, &num2); int remainder = num1 % num2; printf("The remainder when %d is divided by %d is: %d\n", num1, num2, remainder); return 0; }5. Rectangle Perimeter
C
#include <stdio.h> int main() { int length, width; printf("Enter length and width of the room: "); scanf("%d %d", &length, &width); int perimeter = 2 * (length + width); printf("The perimeter of the room is: %d\n", perimeter); return 0; }Part 2: Floating-Point Math (
float,%.2f,%.1f)6. Temperature Converter
C
#include <stdio.h> int main() { float celsius; printf("Enter temperature in Celsius: "); scanf("%f", &celsius); float fahrenheit = (celsius * 9.0 / 5.0) + 32.0; printf("%.2f C = %.2f F\n", celsius, fahrenheit); return 0; }7. Discount Calculator
C
#include <stdio.h> int main() { float price, discount_pct; printf("Enter original price: "); scanf("%f", &price); printf("Enter discount percentage: "); scanf("%f", &discount_pct); float savings = price * (discount_pct / 100.0); float final_price = price - savings; printf("You save: $%.2f\n", savings); printf("Final price to pay: $%.2f\n", final_price); return 0; }8. Circle Area & Circumference
C
#include <stdio.h> int main() { float radius; const float PI = 3.14159; printf("Enter the radius: "); scanf("%f", &radius); float area = PI * radius * radius; float circumference = 2 * PI * radius; printf("Area: %.2f\n", area); printf("Circumference: %.2f\n", circumference); return 0; }9. Average of Three Exam Scores
C
#include <stdio.h> int main() { float m1, m2, m3; printf("Enter three exam scores: "); scanf("%f %f %f", &m1, &m2, &m3); float avg = (m1 + m2 + m3) / 3.0; printf("Average Score: %.1f\n", avg); return 0; }10. Currency Conversion
C
#include <stdio.h> int main() { float inr; const float INR_TO_USD = 0.012; // Example exchange rate printf("Enter amount in Indian Rupees (INR): "); scanf("%f", &inr); float usd = inr * INR_TO_USD; printf("%.2f INR is approximately $%.2f USD\n", inr, usd); return 0; }Part 3: Characters & ASCII Values (
char,%c)11. Single Letter Echo
C
#include <stdio.h> int main() { char ch; printf("Type a single character: "); // Note the space before %c to skip any lingering newline scanf(" %c", &ch); printf("You pressed key: %c\n", ch); return 0; }12. Secret Code (ASCII Value)
C
#include <stdio.h> int main() { char ch; printf("Enter a single letter: "); scanf(" %c", &ch); printf("%c has ASCII value %d\n", ch, ch); return 0; }13. Next Letter in Line
C
#include <stdio.h> int main() { char ch; printf("Enter a letter: "); scanf(" %c", &ch); char next = ch + 1; printf("The next character is: %c\n", next); return 0; }14. Simple Upper-to-Lower
C
#include <stdio.h> int main() { char upper; printf("Enter a capital letter: "); scanf(" %c", &upper); // Adding 32 converts uppercase ASCII to lowercase char lower = upper + 32; printf("Lowercase: %c\n", lower); return 0; }15. Grade Inspector
C
#include <stdio.h> int main() { char grade; printf("Enter your grade (A, B, or C): "); scanf(" %c", &grade); if (grade == 'A' || grade == 'a') { printf("Outstanding work! Keep shining!\n"); } else if (grade == 'B' || grade == 'b') { printf("Great job! You are doing very well!\n"); } else if (grade == 'C' || grade == 'c') { printf("Good effort! Keep practicing and you will grow!\n"); } else { printf("Keep working hard and learning!\n"); } return 0; }Part 4: Strings & Mixed Mini-Projects (
char[],%s, mixed types)16. Friendly Greeting
C
#include <stdio.h> int main() { char name[50]; printf("Enter your first name: "); scanf("%s", name); printf("Welcome to C programming, %s!\n", name); return 0; }17. Name Length Counter
C
#include <stdio.h> #include <string.h> int main() { char name[50]; printf("Enter a one-word name: "); scanf("%s", name); int length = strlen(name); printf("The name \"%s\" has %d characters.\n", name, length); return 0; }18. Personalized ID Badge
C
#include <stdio.h> int main() { char name[50]; int age; char blood_group; printf("Enter first name: "); scanf("%s", name); printf("Enter age: "); scanf("%d", &age); printf("Enter blood group letter (e.g. O, A, B): "); scanf(" %c", &blood_group); printf("\n=============================\n"); printf(" NAME : %s\n", name); printf(" AGE : %d\n", age); printf(" BLOOD GROUP : %c+\n", blood_group); printf("=============================\n"); return 0; }19. Grocery Bill Generator
C
#include <stdio.h> int main() { char item[50]; int qty; float price; printf("Enter item name: "); scanf("%s", item); printf("Enter quantity: "); scanf("%d", &qty); printf("Enter unit price: "); scanf("%f", &price); float total = qty * price; printf("\n--- GROCERY RECEIPT ---\n"); printf("Item : %s\n", item); printf("Qty : %d\n", qty); printf("Price : $%.2f\n", price); printf("Total : $%.2f\n", total); printf("-----------------------\n"); return 0; }20. Mini Mad-Libs Game
C
#include <stdio.h> int main() { char friend_name[50]; char animal[50]; int lucky_num; float favorite_decimal; printf("Enter a friend's name: "); scanf("%s", friend_name); printf("Enter an animal: "); scanf("%s", animal); printf("Enter your lucky number: "); scanf("%d", &lucky_num); printf("Enter your favorite decimal number: "); scanf("%f", &favorite_decimal); printf("\n--- THE STORY ---\n"); printf("One sunny afternoon, %s adopted a talking %s.\n", friend_name, animal); printf("Together, they found %d gold coins hidden under a rock.\n", lucky_num); printf("The %s happily munched on %.2f slices of watermelon and fell asleep!\n", animal, favorite_decimal); return 0; }