school/do_while_znak.c

21 lines
378 B
C
Raw Normal View History

2023-12-18 14:54:52 +01:00
//
// Created by bruno on 12/11/23.
//
#include "do_while_znak.h"
#include "stdio.h"
int do_while_znak(){
int c;
int pocet = 0;
const int koniec = 'k';
do {
c = getchar();
putchar(c);
pocet++;
} while (c != koniec);
printf("\nVydržal si %d znakov pred tým, ako si napísal %c (vrátane) .\n", pocet, koniec);
return 0;
}