Anyone know how to use EasyC Programming?

aurareturn

Senior member
Jul 1, 2005
305
0
0
I need help with my homework but I have no idea how to do it. My professor is a moron and didn't even teach us how to use the easyC program at all to write codes.

So if anyone knows how to do these, please help me out a bit. :)

(3) Write a program to add all the odd numbers between 0 and 100.
(4) Write a program to find and copy the smallest value of the variables A, B, C, and D to the variable ?MIN?.
(5) Write a program to find and copy the 2nd largest value of the variables A,B, C, and D to the variable ?SECOND?. If there is a tie, use the tie value. Consider the following example.
4, 5, 8, 8, 9 => SECOND = 8
7, 7, 7, 7 => SECOND =7
9, 5, 2, 2 => SECOND = 5
2
 

imported_stev

Senior member
Oct 27, 2005
368
0
0
Are you having an issue with syntax or the theory behind programming such tasks?

Who cares if your professor is a moron or not. This is what programming is all about. Dive in and you may surprise yourself at how far you get.

ATOT, please don't just do this person's homework, just provide hints and such.
 

aurareturn

Senior member
Jul 1, 2005
305
0
0
Originally posted by: stev
Are you having an issue with syntax or the theory behind programming such tasks?

Who cares if your professor is a moron or not. This is what programming is all about. Dive in and you may surprise yourself at how far you get.

ATOT, please don't just do this person's homework, just provide hints and such.

I am not asking for anyone to do my hw. I am just asking for some help.

I already did #3 but I don't understand #4 at all. Am I suppose to make up variables for A, B, C, and D and then write some "ifs" to find the lowest integer?
 

imported_stev

Senior member
Oct 27, 2005
368
0
0
Originally posted by: aurareturn
I already did #3 but I don't understand #4 at all. Am I suppose to make up variables for A, B, C, and D and then write some "ifs" to find the lowest integer?

Instead of defining values for A, B, C, and D you could define them as the input variables of a function or have the program ask for user input of four variables. If statements would work fine.
 

aurareturn

Senior member
Jul 1, 2005
305
0
0
Originally posted by: stev
Originally posted by: aurareturn
I already did #3 but I don't understand #4 at all. Am I suppose to make up variables for A, B, C, and D and then write some "ifs" to find the lowest integer?

Instead of defining values for A, B, C, and D you could define them as the input variables of a function or have the program ask for user input of four variables. If statements would work fine.

Would it be something like:

min=A;
if (B<min)
min=B;

if (C<min)
min=c;

 

imported_stev

Senior member
Oct 27, 2005
368
0
0
Originally posted by: aurareturn
Originally posted by: stev
Originally posted by: aurareturn
I already did #3 but I don't understand #4 at all. Am I suppose to make up variables for A, B, C, and D and then write some "ifs" to find the lowest integer?

Instead of defining values for A, B, C, and D you could define them as the input variables of a function or have the program ask for user input of four variables. If statements would work fine.

Would it be something like:

min=A;
if (B<min)
min=B;

if (C<min)
min=c;


That'll do it.