100% found this document useful (1 vote)
100 views

Lab Manual 2

This document contains instructions and code snippets for 6 programming questions involving if/else statements in C++. The questions cover finding the largest of three numbers, determining a student's grade based on test score, identifying vowels and consonants, determining if a number is even or odd, identifying capital and lowercase letters, and determining the state of water based on temperature. The document provides the prompt for each question and includes a labeled "Code Area" for the C++ code solution.

Uploaded by

Videos4u iK
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
100 views

Lab Manual 2

This document contains instructions and code snippets for 6 programming questions involving if/else statements in C++. The questions cover finding the largest of three numbers, determining a student's grade based on test score, identifying vowels and consonants, determining if a number is even or odd, identifying capital and lowercase letters, and determining the state of water based on temperature. The document provides the prompt for each question and includes a labeled "Code Area" for the C++ code solution.

Uploaded by

Videos4u iK
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab Manual # 2 if/if-else

statements

2.1 Que No 1 Largest value among three

Write a program in C++ that take input of three integer‘s numbers from user. Find
the largest number among three of them.
2.1.1 Code Area

2.2 Que No 2 Grade Program using nested if else


Write a program in C++ using if/else operator with nested statements to find the
grade of a student.
The detail is as follow.

grade >= 90 Grade A

grade >= 80 Grade B

grade >=70 Grade C

grade >=60 Grade D
2.2.1 Code Area
2.3 Que No 3 vowel / Consonant

Write a program in C++ to input a single character and print a message― It is


vowel" if it is vowel otherwise print message "It is a "consonant― Use if-else
structure and OR (||) operator only

2.3.1 Code

2.4 Que No 4 Even / Odd


Write a Program in C++ that take an Integer Value from the user and tell that
the number is EVEN or ODD.

2.4.1 Code Area

2.5 Que No 5 Capital / Small Letter


Write a program in C++ that take a single character from the user, and tells it's a
Small Letter or it's a CAPITAL letter using nested if statement only.
2.5.1 Code Area

2.6 Que No 6 Ice / water / steam


Make a program in C ++ that tells the form of Water whether it is Ice,
Water or Steam. Display the menu also as under.

Temperature Less than 0 = ICE


Temperature Greater than 0 & Less than 100 = Water
Temperature Greater than 100 = STEAM

2.6.1 Code Area

You might also like