🔒 Closed Sa mga Comsci or IT patulong po C++

Status
Not open for further replies.

ak_gld

Eternal Poster
Write a code fragment that tests the value of an integer num. If the value of num is 10, square num. If it is 9, read a new value into num. If it is 2 or 3, multiply num by 99 and print out the result. Implement your code using swtich.
medyo lito lng po
 
Steps:

Declare an Integer variable num1.

Read value of variable num1,

if num1 is 9 then again read a new value into num1,

if num1 is 10 then square it.

if num1 is 2 or 3 multiply it by 99.

at the end display the value of num1
 
Status
Not open for further replies.

About this Thread

  • 5
    Replies
  • 392
    Views
  • 3
    Participants
Last reply from:
ak_gld

Trending Topics

Online now

Members online
1,092
Guests online
5,162
Total visitors
6,254

Forum statistics

Threads
2,354,437
Posts
29,383,655
Members
1,079,454
Latest member
jialeyne5566
Back
Top