127: Write a program that input a number from the user and displays next five number and square of those five numbers.
// Write a program that input a number from the user and displays next five number and square of those five numbers.
#include <iostream>
using namespace std;
int main()
{
int num;
cout << "Enter a number: ";
cin >> num;
int i = num + 1;
while (i <= (num + 5))
{
cout << i << " and square of " << i << " is: " << i * i << endl;
i++;
}
return 0;
}
Comments
Post a Comment