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

If/Else Statement Programming Tasks

The document outlines an assignment with programming tasks focused on using if/else statements in various scenarios. It includes six questions that require writing programs to determine positive/negative numbers, eligibility based on age, finding the largest of three numbers, calculating GPA-based scholarships, finding the smallest of five numbers, and calculating factorials or cubes based on odd/even input. The assignment deadline is set for December 19, 2021.

Uploaded by

Abdullah Rauf
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)
4 views2 pages

If/Else Statement Programming Tasks

The document outlines an assignment with programming tasks focused on using if/else statements in various scenarios. It includes six questions that require writing programs to determine positive/negative numbers, eligibility based on age, finding the largest of three numbers, calculating GPA-based scholarships, finding the smallest of five numbers, and calculating factorials or cubes based on odd/even input. The assignment deadline is set for December 19, 2021.

Uploaded by

Abdullah Rauf
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

Assignment # 3

1st 3 Questions are Lab Task and Perform in Lab

IF ELSE STATEMENT

The if/else statement executes a block of code if a specified condition is


true. If the condition is false, another block of code (else) can be
executed.
Here are the few programs using If/else statement.

Q1. Write a simple program using if else statement to find the positive
and negative number.

Q2. Write a program and the ask the age from the user and identify using
if else statement that if age is greater than 18 or less than 30 then print
You are eligible for this job if not then print you are not eligible for this
job.

Q3. Write a program to find largest number out of 3 given numbers.

Q4. Write a simple program to calculate the gpa of students. If the gpa is
greater than 3.95 then 100% scholarship, if gpa is greater than 3.90 or
less than 3.95 then the scholarship is 75%, if gpa is greater than 3.50 or
less than 3.90 than the scholarship is 50%, if gpa is greater than 3.25 gpa
is less than 3.50 then the scholarship is 25% and if gpa is less than 3.00
then you got 0% scholarship.
Q5. Write a program to find smallest number out of 5 given numbers.

Q6. Write a program to find factorial of number if user enter odd number
and find cube of number if user enter even number.

Deadline: 19/12/2021

You might also like