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

CSC126 Tutorial 5 (Part2)

This document outlines 4 tasks involving selection structures in C++. Task 1 has the user write a program to check if two integers are equal. Task 2 asks the user for a number and displays if it's greater than or less than zero. Task 3 is to write a program based on pseudocode for a selection structure. Task 4 has the user write a program to determine and print if an integer is odd or even using the modulus operator.

Uploaded by

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

CSC126 Tutorial 5 (Part2)

This document outlines 4 tasks involving selection structures in C++. Task 1 has the user write a program to check if two integers are equal. Task 2 asks the user for a number and displays if it's greater than or less than zero. Task 3 is to write a program based on pseudocode for a selection structure. Task 4 has the user write a program to determine and print if an integer is odd or even using the modulus operator.

Uploaded by

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

Tutorial 5 (Part 2): Selection Structure

Task 1: Write a C++ program to accept two integers and check whether they are equal or not.

Task 2: Write a program that will asks user for a number. It then displays whether the number is (greater
than zero) or (less than or equal to zero).

Task 3: Write a complete C++ program based on the following pseudocode.


Task 4: Write a program that reads an integer and determines and prints whether it is odd or
even. (Hint: use modulus operator)

You might also like