Sie sind auf Seite 1von 2

#include<iostream.h> #include<conio.

h>

class power { int x,y,p;

public:

void input() { cout<<"the value of x and y is:"<<endl; cin>>x>>y;

void pwr() { int p=1; int i=0;

while (i<=y)

{ p=p*x; i++;

cout<<"the value is:"<<p; } } }p1,p2;

void main() { p1.input(); p2.pwr(); getch(); }

Das könnte Ihnen auch gefallen