Write a C++ program that performs the following tasks:
1-Print your name and VU id.
2-Add last 3 digit of your VU id.
3-Display the result of sum on screen.
4-Use if-else statement.
If sum is odd then print your name using while loop. Number of iterations of while loop should be equal to the sum.
If sum is even then print your VU id using while loop. Number of iterations of while loop should be equal to the sum.
[use remainder operator on sum value to
determine the odd and even value for if condition]
For example, suppose the student id is BC123456781. Then by adding last 3 digits of vu id, we get 16 which is an even number. In this case, program should print your VU ID for 16 times using while loop.
Click Here
Code | Book | Task | Solution |
---|---|---|---|
STA301 | Statistics and Probability | GDB Fall 2021 | View |
CS201 | Introduction To Programming | Assignment No 1 Fall 2021 | View |
MGT301 | Introduction To Marketing | Assignment No 1 Fall 2021 | View |