CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️
#include <iostream> // ❗️ ❗️ ➖➕➖
using namespace std; // ➕➖➕ ❗️
// ❗️ ❗️ ➖➕➖
int main()
{
int a;
cin>>a;
if(a>=1){
int x = a,y = a;
while (x <=y){
cout <<"square |"<<x<<"| is |"<<x*x<<"|"<<endl;
cout <<"cube |"<<x<<"| is |"<<x*x*x<<"|"<<endl;
cout <<":::::::::::::::::::::::::::::::"<<endl;
x += 1;
}
}
else{
int x = 2,y = 100;
while (x <=y){
cout <<"square |"<<x<<"| is |"<<x*x<<"|"<<endl;
cout <<"cube |"<<x<<"| is |"<<x*x*x<<"|"<<endl;
cout <<":::::::::::::::::::::::::::::::"<<endl;
x += 1;}
}
return 0;
}
//⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️➖⭕️
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run