repo.or.cz
/
letusc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
move to repo.or.cz
[letusc.git]
/
ch3
/
exercises
/
ex3.c
blob
2a482e24fa696c4182ff70ae9cedb84265355c22
1
/*one number power another */
2
3
#include<stdio.h>
4
5
int
main
()
6
{
7
int
p
,
q
;
8
long
ans
=
1
;
9
printf
(
"Enter numbers p and q:"
);
10
scanf
(
"%d %d"
,&
p
,&
q
);
11
12
while
(
q
>
0
)
13
{
14
15
ans
=
ans
*
p
;
16
17
q
--;
18
}
19
printf
(
"The power of the number is %ld
\n
"
,
ans
);
20
return
0
;
21
}