Z
Z
zaheer2020-09-10 19:58:01
C++ / C#
zaheer, 2020-09-10 19:58:01

How to make a C program that will ask the user for an integer [0;99] and display it in words on the screen?

You need to write a program that asks the user for an integer [0..99] and then displays the number in words on the screen. And if the user entered an incorrect number, then the program should ask you to enter a number from this range again.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
LoliDeveloper, 2020-09-10
@zaheer

Something like this, but I'm tired of writing, I'll go to sleep

int main(void)
{
  int x = -1;
  char one[4] = "один";
  char two[3] = "два";
  char three[3] = "три";
  char fout[6] = "четыре";
  char five[4] = "пять";
  char six[5] = "шесть";
  char seven[4] = "семь";
  char eight[6] = "восемь";
  char nine[6] = "девять";
  char tenPlus[6] = "надцать";
  char tventy[8] = "Двадцать";
  while(x < 0 || > 99)
  {
    printf("Введите число:\n");
    scanf("%d", &x);
    if(x < 0 || x > 99) printf("Введите число от 0 до 99:\n");
  }
    switch(x)
    {
      //логика
    }
  
}

C
CityCat4, 2020-09-10
@CityCat4

Looks like the school year has begun...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question