#include
void main()
{
float base=0;
float expo=0;
float a=0;
float r=0;
window(1,1,80,50);
textbackground(4);
textcolor(7);
clrscr();
gotoxy(31,1);
cprintf("By Jail");
window(2,2,77,49);
textbackground(5);
textcolor(0);
clrscr();
window(3,3,76,48);
textbackground(6);
textcolor(0);
clrscr();
window(4,4,75,47);
textbackground(7);
textcolor(0);
clrscr();
window(5,5,75,46);
textbackground(1);
textcolor(0);
clrscr();
window(6,6,73,45);
textcolor(7);
textbackground(0);
clrscr();
gotoxy(1,1);
cout<<" Digite o valor da base ";
cin>>base;
gotoxy(1,2);
cout<<" Digite o expoente ";
cin>>expo;
a=base;
for(int i=2; i<=expo; i++)
{
r=a*base;
a=r;
}
if(expo==0) r=1;
if(expo==1) r=base;
if((expo>10)&&(base>5))
{
gotoxy(15,10);
textcolor(4+BLINK);
cprintf(" ERRO valor elevado ");
}
else
{
gotoxy(1,3);
cout<<" resposta "<
}
getche();
}
Nenhum comentário:
Postar um comentário