>"Frederick Gotham" writes:
>Hey dude! I had this assignment myself just recently... got an A! Here's
the code:
#INCLUDE "iostream.h"
I would have expected a grade of 'F' in a C++ course!
>using std { cout, cin };
void main(){
Maybe even less than an 'F'!! (int main(){ return 0;})
> int[5] arr;
int min = INT_MAX,max = 0;
I would expect a problem if the user enters all negative numbers.
I would expect a joke to have a smiley :-}, or a grin <G>.
>
> for(i = arr; i < 5; i++){
Magic numbers? 'i' don't get it.
> cout << "Enter Number: ";
cin >i;
Hey, I entered "-#@&$" here!!
>>
if (i<min) min = i;
if (i>max) max = i;
}
cout << "Smallest: " << min
<< "Biggest: " << max;
}
Compiles with zero errors and zero warning on all conforming compilers!
Runs like a jem! Hope that helps.
On Comeau? Did you mean, "It runs like a JAM." (more like 'jelly').
I think what you were trying to show was:
void Painfull(int ouch){
while(true){ for(;;){ Painfull(++ouch);}}
return;
}
int main(){
Painfull(42);
return 0;
}
Pass that one through your "conforming compiler"! <G>
Sorry Fred. The devil made me do it!!
(pretty mean, Fred!! Do you also pull the wings off of flies? :-} )
[ Thanks for the use of your post, osmium. (I didn't load that message.) ]
--
Bob R
POVrookie