0% found this document useful (0 votes)
8 views

C Coding Questions Set01

Uploaded by

uditha tharuka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

C Coding Questions Set01

Uploaded by

uditha tharuka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1) Write a C program to prompt the user to enter their name and age, and then print a

greeting that includes their name and age.

2) Write a C program to input two integers and display their sum, difference, product,
and quotient.

3) Write a C program to swap the values of two integer variables without using a third
variable.

4) Write a C program to calculate the area of a rectangle. Take the length and width as
input and display the area.

5) Write a C program to convert a temperature from Celsius to Fahrenheit. The formula


is:
Fahrenheit = (Celsius × 9/5)+32

6) Write a C program to calculate the simple interest. Use the formula:


Simple Interest = (Principal × Rate × Time) /100
Take the principal, rate, and time as input.

7) Write a C program to check if a given integer is odd or even. Display the result
accordingly.

8) Write a C program to input a character and display its ASCII value.

9) Write a C program to read an integer and display its square.

10) Write a C program that takes an integer number of days as input and converts it into
years, weeks, and days. Assume a year has 365 days and a week has 7 days.

11) Write a C program to check if a number is divisible by both 5 and 3 using the
arithmetic and logical operators.

12) Find the Maximum of Two Numbers

13) Check if a Number is Positive, Negative, or Zero

14) Check if a Number is Even or Odd

15) Find the Sum of Two Numbers

16) Swap Two Numbers Using Bitwise XOR Operator

17) Check if a Number is Between 10 and 20

18) Check if a Number is Divisible by 2 or 7

19) Find the Average of Three Numbers

20) Check if a Number is a Prime Number

You might also like