Computer Science, asked by yowhatsup61, 3 months ago

Write a program to check whether a number is even or odd

from 1 to 100 using while loop.

Then, follow the given conditions

Condition 1 - If a number is even then you need to add all even numbers and store in variable e. Along with this you need to

check the followings -

(i) If Num<50 - Print the square of that number.

(ii) If Num>50 - Print "Hello world"

Condition 2- If a number is odd then you need to add all odd numbers in variable o. Along with this you need to check the followings -

(i) If Num<50- print the area of circle by assuming radius as 2.

(ii) If Num>50 - Print the area of square by assuming the side as 2.

You need to print the value of variable e and o after while loop.​

Answers

Answered by gouravbansiwal86
0

Answer:

1

#include <bits/stdc++.h>

using namespace std;

4 class Test

5

6

public:

7

Test() { cout << "Constructor called" :)

8

9

10 int main()

11

12

Test *t = (Test *) malloc(sizeof (Test));

13

return 0;

)

15

Similar questions