Lab8 - Tao Lin EE140 Lab 8 Q1 a printf"%c",f[6 b...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Tao Lin EE140 Lab 8 Q1 a) printf( "%c" ,f[6]); b) scanf( "%d" ,&b[4]); c) int g[5]={8,8,8,8,8}; d) for (i=0;i<10;i++) b[i]=a[i]; //-------------------------------------------------------------------------- //Lab8 Q2 Tao Lin //A program that read 5 integers and store them in an array. It finds the //minimun and display it on the screen //------------------------------------------------------------------------- #include <stdio.h> int main( void ) { int ary[5],i,min; for (i=0;i<5;i++) { printf( "Enter integer %d: " ,i+1); scanf( "%d" ,&ary[i]); if (i==0) //for the first element, assign its value to min without compare min=ary[i]; else //for the rest element, compare to find the smaller value { if (ary[i]<min) min=ary[i]; } } printf( "The minimum value in this array is %d\n\n" ,min); return 0; } RESULT: Enter No.1 integer: 6 Enter No.2 integer: 5 Enter No.3 integer: 9 Enter No.4 integer: 4 Enter No.5 integer: 8 The minimum value in this array is 4 Press any key to continue . . . //--------------------------------------------------------------------------...
View Full Document

{[ snackBarMessage ]}

Page1 / 3

Lab8 - Tao Lin EE140 Lab 8 Q1 a printf"%c",f[6 b...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online