C PROGRAM PRACTICE
PROBLEMS
Basic Level
Hello World Program
Sum of Two Numbers
Even or Odd
Largest of Two Numbers
Simple Calculator
Factorial of a Number
Fibonacci Series
Check for Prime Number
Sum of Digits
Intermediate Level (Arrays, Strings, Functions)
Focus: arrays, string manipulation, functions, loops, logic.
Find Largest Element in an Array
Matrix Addition / Multiplication
Count Vowels, Consonants, Digits, and Spaces in a String
Check Palindrome (String or Number)
Sort an Array (Bubble Sort / Selection Sort / Insertion Sort)
Find Second Largest Element in Array
, Convert Decimal to Binary / Binary to Decimal
Transpose of a Matrix
Concatenate Two Strings Without Using strcat()
Count Occurrences of Each Element in an Array
Advanced Level (Pointers, Structures, Files)
Focus: memory management, file handling, data structures.
Swap Two Numbers Using Pointers
Find Length of a String Using Pointers
Dynamic Memory Allocation (malloc, calloc, free)
Example: store N integers dynamically and compute their
average.
Structure for Student Information
Store name, roll number, marks, and display details.
File Handling – Copy File Content
Copy contents from one text file to another.
Count Lines, Words, and Characters in a File
Implement Linked List (Insertion, Deletion, Display)
Stack Implementation Using Array / Linked List
Queue Implementation
Simple Bank Management System
Using structures and file handling.
,Challenge / Mini Project Ideas
Once you’re comfortable with the above, try these:
Tic-Tac-Toe Game (2 players)
Student Management System
Library Management System
Mini Calculator with Menu
Simple Quiz Game
Number Guessing Game
Temperature Converter (Celsius ↔ Fahrenheit)
, Answer Programs
Basic Level
Hello World Program
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
Sum of Two Numbers
#include <stdio.h>
int main() {
int a, b, sum;
printf("Enter two numbers: ");
scanf("%d %d", &a, &b);
sum = a + b;
printf("Sum = %d\n", sum);
return 0;
}
Even or Odd
PROBLEMS
Basic Level
Hello World Program
Sum of Two Numbers
Even or Odd
Largest of Two Numbers
Simple Calculator
Factorial of a Number
Fibonacci Series
Check for Prime Number
Sum of Digits
Intermediate Level (Arrays, Strings, Functions)
Focus: arrays, string manipulation, functions, loops, logic.
Find Largest Element in an Array
Matrix Addition / Multiplication
Count Vowels, Consonants, Digits, and Spaces in a String
Check Palindrome (String or Number)
Sort an Array (Bubble Sort / Selection Sort / Insertion Sort)
Find Second Largest Element in Array
, Convert Decimal to Binary / Binary to Decimal
Transpose of a Matrix
Concatenate Two Strings Without Using strcat()
Count Occurrences of Each Element in an Array
Advanced Level (Pointers, Structures, Files)
Focus: memory management, file handling, data structures.
Swap Two Numbers Using Pointers
Find Length of a String Using Pointers
Dynamic Memory Allocation (malloc, calloc, free)
Example: store N integers dynamically and compute their
average.
Structure for Student Information
Store name, roll number, marks, and display details.
File Handling – Copy File Content
Copy contents from one text file to another.
Count Lines, Words, and Characters in a File
Implement Linked List (Insertion, Deletion, Display)
Stack Implementation Using Array / Linked List
Queue Implementation
Simple Bank Management System
Using structures and file handling.
,Challenge / Mini Project Ideas
Once you’re comfortable with the above, try these:
Tic-Tac-Toe Game (2 players)
Student Management System
Library Management System
Mini Calculator with Menu
Simple Quiz Game
Number Guessing Game
Temperature Converter (Celsius ↔ Fahrenheit)
, Answer Programs
Basic Level
Hello World Program
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
Sum of Two Numbers
#include <stdio.h>
int main() {
int a, b, sum;
printf("Enter two numbers: ");
scanf("%d %d", &a, &b);
sum = a + b;
printf("Sum = %d\n", sum);
return 0;
}
Even or Odd