include stdio include iostream include iomanip int Kolvo_Elem int main

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <stdio.h>
#include <iostream.h>
#include <iomanip.h>
int Kolvo_Elem();
int main()
{
printf( "Choose the item of the menu:\n" );
printf("\nInput the array:\n");
printf( "1. Input the number of elements of the array\n" );
printf( "2. Manual input array\n" );
printf( "3. Random input array\n" );
printf( "\nOutput of result of array's work:\n" );
printf( "4. Step by step result of the program\n" );
printf( "5. Final result of the program\n" );
printf( "6. Exit\n" );
printf( "My choise: " );
int input;
scanf( "%d", &input );
switch ( input )
{
case 1:
Kolvo_Elem();
break;
case 2:
return 0;
break;
default:
printf( "Wrong input. Choose right!\n" );
}
getchar();
return 0;
}
int Kolvo_Elem()
{
int number;
while(true)
{
scanf("%d", &number);
if(number<0 || number>=100)
printf("Enter an integer from 0 to 100");
break;
}
return number;
}