Home > Back-end >  Write a c program, array store number 5, and in accordance with the order of the input output
Write a c program, array store number 5, and in accordance with the order of the input output

Time:09-29

Input is stored in the array yuan prime: 5
In an array of input number 5:
15
10
12
22
67
The expected output:
Stored in the first element in the array is:
No. 15 October 12 22 67
Copied to the second element of the array is:
15 October 12 no. 22, 67

CodePudding user response:

The basic operations, reading a book

CodePudding user response:

//reference, to modify the
#include
# define VALBUFF_LEN 5
Double valBuff [VALBUFF_LEN];
Int main (int arg c, char * argv [])
{
int i=0;
Int j=0;
Char ret=0;
Double very=0;
Double minVal=0;
//int valBuff [VALBUFF_LEN];
Printf (" array maximum differential minimum value! \n");
Do {
Printf (" please enter the % d a number! \ n ", VALBUFF_LEN);
for(i=0; i{
Lf the scanf (" % ", & amp; ValBuff [I]);
Printf (" input number: ");
for(j=0; j{
Printf (" % lf, "valBuff [j]);
}
printf("\n");
}

printf("\n");
//to empty the input stream
{
Char c=0;
While (((c=getchar ())! )='\ n' & amp; & C!!!=(EOF);
}
Ret=getchar ();
Putchar (ret); Putchar (" \ n "); Putchar (" \ n ");
} while (ret!='0');
return 0;
}

CodePudding user response:

Pseudo code (without array)

Int a, b, c, d, e;
Cin> a> B> C> D> e;
Printf (" % d % d % d % d % d \ n ", a, b, c, d, e);
  • Related