Sunday, June 6, 2021

program enter a number and check the square using function (POP) (156)

#include<iostream>

using namespace std;

int squ(int);

int main()

{

int num,n;

cout<<"please enter a number for square:";

cin>>num;

n=squ(num);

cout<<"the square of this number is:"<<n<<endl;

}

int squ(int num)

{

return num*num;

} 

No comments:

Post a Comment