jazykc  2013.3
upoljazykc
 All Classes Files Functions Variables Typedefs Macros Pages
nasobilka.c
Go to the documentation of this file.
1 
22 #include <stdio.h>
23 #include <stdlib.h>
24 
25 int main(int c, char *argv[]) {
26  int cislo, n, nasobek;
27 
28  printf("Zadej cislo pro nasobky: "); fflush(stdout);
29  if (1 != (n=scanf("%d", &cislo))) {
30  fprintf(stderr, "Usage: %s cislo\n", argv[0]); return EXIT_FAILURE;
31  }
32 
33  printf("Nasobky zadaneho cisla:\n");
34  n = 1;
35  while (1) {
36  nasobek = n * cislo;
37  if (nasobek > 100) break;
38  printf("%2d, ", nasobek);
39  if (!(n % 10)) putchar('\n');
40  n++;
41  }
42  putchar('\n');
43 
44  return EXIT_SUCCESS;
45 }