Thursday, July 10, 2008
lab 7 qns 5a (if im nt wrong...this is optional...is it? o.O)
#include iostream //add in < >
using namespace std;
int main()
{
int num[4];
int count, max, zero_count;
//part i
for ( count = 0; count <>> num[count];
}
//part ii
count = 0;
while ( count < max =" num[0];" count =" 0;"> max )
max = num[count];
}
cout << "\n\n The maximum value in the array is " << max << endl;
//part iv
zero_count = 0;
for ( count = 0; count < 4; count ++)
{
if (num[count] == 0) // if 0s in multiples of 10 are counted, change to: if (num[count]%10 == 0)
zero_count++;
}
cout << "\n Number of zeros entered: " << zero_count << endl;
return 0;
}
hopefully dere's no error in this code.
---abigail =)
; tortured on 11:50 PM =/
__________________________________
the1B02
ONE class of FIFTEEN gentlemen and FIVE ladies
average age of SEVENTEEN
first met each other on 8th apr 08 at T1442
we are
environmental friendly
theCREWS
Designer: no idea
Code Edited: abigail/han sheng
Picture: photobucket
Host: blogger::
photobucket
Thanks: blogskins
click THIS: ♥
thecopyCATS
this blog was created by HANSHENG.
the templater was ABIGAIL.
blogskin found by JESSLE.
you are NOT ALLOWED to copy or take anything from HERE. trespassers WILL be prosecuted.