0% found this document useful (0 votes)
4 views3 pages

C Programming Practice Questions

This document provides a comprehensive set of C programming practice questions categorized by difficulty levels: beginner, intermediate, and advanced. It covers fundamental concepts such as variables, data types, I/O operations, and various programming challenges to enhance problem-solving skills. Tips for success are also included to guide learners in mastering C programming fundamentals.

Uploaded by

magesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

C Programming Practice Questions

This document provides a comprehensive set of C programming practice questions categorized by difficulty levels: beginner, intermediate, and advanced. It covers fundamental concepts such as variables, data types, I/O operations, and various programming challenges to enhance problem-solving skills. Tips for success are also included to guide learners in mastering C programming fundamentals.

Uploaded by

magesh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd

#C Programming Practice Questions

Based on Brototype Tamil Tutorial - Variables, Data Types & I/O Operations

Introduction
This document contains a comprehensive set of C programming practice questions organized
by difficulty levels. These questions cover fundamental concepts including variables, data types,
input/output operations using scanf() and printf(), logical and relational operators, and basic
problem-solving. Practice these questions to strengthen your understanding of C programming
fundamentals.

BEGINNER LEVEL
Basic Variable Declaration, Data Types, and Simple I/O Operations
1. Simple Input and Output
• Write a program to read an integer from the user and print it.
• Write a program to read a float value and display it with 2 decimal places.
• Write a program to read a character and print it.
2. Sum of Two Numbers
• Write a program to read two integers and print their sum.
• Write a program to read two float numbers and display their sum with proper formatting.
3. Average of Numbers
• Write a program to find the average of three numbers entered by the user.
• Write a program to read two integers and display their average as a float.
4. Variable Swapping
• Write a program to read two variables and swap their values without using a temporary
variable.
• Write a program to read two integers, display the original values, then swap and display
the swapped values.
5. Basic Arithmetic Operations
• Write a program to read two numbers and display their sum, difference, product, and
quotient.
• Write a program to calculate the area of a rectangle given length and width as input.
• Write a program to calculate the area of a circle given its radius.

INTERMEDIATE LEVEL
Logical and Relational Operators, Conditional Logic, and Complex Calculations
6. Largest of Two Numbers
• Write a program using relational operators to find and display the largest of two
numbers.
• Extend the program to also display which number is smaller and whether they are equal.
7. Largest of Three Numbers
• Write a program to find the largest of three numbers using nested conditionals.
• Also find and display the smallest and middle values among the three numbers.
8. Positive, Negative, or Zero
• Write a program to check if a given number is positive, negative, or zero.
• Write a program to check if a number is even or odd using the modulo operator.
• Write a program to determine if a number is both positive and even.
9. Multiple Swaps and Comparisons
• Write a program to read three variables, compare them, and display them in ascending
order.
• Write a program to swap two variables only if the first is greater than the second.
10. Age Verification
• Write a program that reads a person's age and determines if they are a minor (<18) or
an adult (>=18).
• Extend it to categorize as child (<13), teenager (13-19), or adult (20+).
11. Percentage and Grade Calculation
• Write a program to read marks in three subjects and calculate the average percentage.
• Based on the percentage, assign grades: A (90-100), B (80-89), C (70-79), D (60-69), F
(<60).
12. Simple Interest Calculation
• Write a program to calculate simple interest given Principal, Rate, and Time as input.
• Formula: SI = (P * R * T) / 100

ADVANCED LEVEL
Complex Problem-Solving, Multi-Step Logic, and Real-World Applications
13. Quadratic Equation Solutions
• Write a program to find the roots of a quadratic equation (ax² + bx + c = 0) given
coefficients a, b, and c.
• Use the discriminant (b² - 4ac) to determine if roots are real or imaginary.
14. Temperature Conversion
• Write a program that reads a temperature value and a unit (C for Celsius or F for
Fahrenheit) and converts it to the other unit.
• Formula: Celsius to Fahrenheit = (C * 9/5) + 32; Fahrenheit to Celsius = (F - 32) * 5/9
15. BMI (Body Mass Index) Calculator
• Write a program to read weight (in kg) and height (in meters) and calculate BMI.
• Classify the BMI: Underweight (<18.5), Normal (18.5-24.9), Overweight (25-29.9), Obese
(≥30).
• Formula: BMI = weight / (height * height)
16. Number Palindrome Check
• Write a program to check if a given number is a palindrome (reads the same forwards
and backwards).
• Example: 121 is a palindrome, 123 is not.
17. Compound Interest Calculation
• Write a program to calculate compound interest given Principal, Rate, Time, and
Compounding frequency.
• Formula: Amount = P(1 + r/100n)^(nt), where n is frequency
• Display both the final amount and the interest earned.
18. Leap Year Determination
• Write a program to determine if a given year is a leap year.
• Rules: A year is a leap year if: it's divisible by 4 AND (not divisible by 100 OR divisible by
400).
19. Electricity Bill Calculation
• Write a program to calculate electricity bill based on units consumed with tiered pricing.
• Example rates: 0-100 units = $5 per unit, 101-200 = $7 per unit, 201+ = $10 per unit.
• Also add a fixed monthly charge and calculate total bill.
20. Currency Converter
• Write a program that converts an amount from one currency to another.
• Allow conversion between INR, USD, EUR, and GBP using exchange rates.
• Use conditional statements to handle different currency pairs.

Tips for Success


• Start with beginner level questions and master the fundamentals before moving to
intermediate problems.
• Always use meaningful variable names and add comments to explain your logic.
• Test your programs with multiple inputs including edge cases.
• Practice writing code by hand before typing to improve your understanding.
• Don't look at solutions immediately; try to solve problems on your own first.
• Understand the 'why' behind each concept, not just the 'how' to code it.
• Consistency is key: practice daily, even if for just 30 minutes.

You might also like