/* program to find sq + cube acc to input */
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,s;
cout<<"Enter a no"<<endl;
cin>>n;
if((n%2)==0)
s=n*n;
else
s=n*n*n;
cout<<"Rsult = "<<s;
getch();
}
Not Satisfied ? Just search & get the result
Related posts:
- Sample – compute square roots using Newton’s method
- Sample – Program to identify if an input is a symbol, digit or character.
- C++ program – Implementation of class
- Sample – Program to enter an integer and output the cube of that integer.
- Sample – Program to find the sum of each row & column of a matrix of size n x m and if matrix is square, find the sum of the diagonals also..
