0% found this document useful (0 votes)
6 views1 page

Simple C Programs If Else

The document contains a list of simple C programming questions that focus on using if and if-else statements. Each question tasks the reader with writing a program to perform a specific check or calculation, such as determining if a number is positive, even, or within a certain range. Additional challenges include checking for leap years and student pass/fail status.

Uploaded by

ANN RIJA PAUL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Simple C Programs If Else

The document contains a list of simple C programming questions that focus on using if and if-else statements. Each question tasks the reader with writing a program to perform a specific check or calculation, such as determining if a number is positive, even, or within a certain range. Additional challenges include checking for leap years and student pass/fail status.

Uploaded by

ANN RIJA PAUL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Simple C Programming Questions Using if and if-else

1. Write a C program to check if a number is positive.

2. Write a C program to check if a number is even or odd.

3. Write a C program to check if a number is zero or non-zero.

4. Write a C program to find the greatest of two numbers.

5. Write a C program to check if a number is divisible by 5.

6. Write a C program to check if a character is an uppercase letter.

7. Write a C program to check if a number is positive, negative, or zero.

8. Write a C program to check if a year is a leap year.


Hint: A year is a leap year if it is divisible by 4 and not divisible by 100, or if it is
divisible by 400.

9. Write a C program to check if a student passed or failed (pass mark = 40).

10. Write a C program to check if a number is in the range 10 to 100.

You might also like