C++ program to read number n and print n2, n3, n4 and n5.

Q21. Write a program to read a number n and print n2, n3, n4 and n5.

Ans.

#include<iostream.h>

#include<conio.h>  //for clrscr()

 

//Main function

void main()

{

int n,n2,n3,n4,n5;

clrscr();  //for clear screen

cout<<“\n Enter a number: “;

cin>>n;

n2=n*n; Read More …