Friday, March 27, 2020
# include Essays - C Standard Library,
# include stdio.h # include stdlib.h # define SIZE1 100 # define SIZE2 50 int main () double array1[ SIZE1 ]; double array2[ SIZE2 ]; double *parr1=array1, *parr2=array2; int lichylnyk1=0, lichylnyk2=0, check =0; double avg , sum2=0; printf ( " Input first array \n" ); printf ( " Put any letter to stop \n" ); for (; (parr1-array1) SIZE1 ; parr1++) if (! scanf_s ( "%lf" ,parr1)) break ; lichylnyk1++; } /* parr1=array1; for (; (parr1 - array1) lichylnyk ; parr1++) printf ("%d ",*parr1); }*/ getchar (); getchar (); printf ( " Input second array \n" ); printf ( " Put any letter to stop \n" ); for (; (parr2 - array2) SIZE2 ; parr2++) if (! scanf_s ( "% lf " , parr2)) break ; lichylnyk2++; } for (parr2=array2; (parr2 - array2) lichylnyk2; parr2++) sum2+=*parr2; } avg =sum2/lichylnyk2; double arrayforcheck [ SIZE1 ]; int n=0; for ( int i = 0; i lichylnyk1; i++) if ( avg *(array1+i)) *( arrayforcheck+n )=*(array1+i); n++; check =1; } } double min1 = * arrayforcheck ; if ( check ) for ( int i = 0; i n; i++) if (*( arrayforcheck+i )min1) min1= *( arrayforcheck + i); } printf ( "% lf \n" , min1); } else printf ( " Dont exist \n" ); return 0; }
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.