new l5.c
This commit is contained in:
parent
69107ea260
commit
eddf38798a
1 changed files with 28 additions and 0 deletions
28
c/l5.c
28
c/l5.c
|
|
@ -0,0 +1,28 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int pol;
|
||||||
|
printf("Enter number ");
|
||||||
|
scanf("%d", &pol);
|
||||||
|
if(pol > 9) {
|
||||||
|
printf("Error: number must be from 1 to 9\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if(pol < 1) {
|
||||||
|
printf("Error: number must be from 1 to 9\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int x = 1;
|
||||||
|
int s = 0;
|
||||||
|
while(1) {
|
||||||
|
printf("%d * %d = %d\n", pol, x, pol*x);
|
||||||
|
x++;
|
||||||
|
s++;
|
||||||
|
if(s < 10) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue