Jump to content

while

Liam mallka
Go to solution Solved by Dat Guy,

You can use CODE blocks here. Screenshots are harder to debug for us.

 

Anyway, here's a hint:

 

int max1 = 0;
int max2 = 0;

// ...

if (x > max1) max1 = x;
else if (x > max2) max2 = x;

 

The rest is left as an exercise to the reader.

hey I need help with my code 

I need to get that output 

image.png.126062551dddf67addfe15b6d1acf785.png

and I have no idea how to do the first max and second max so far I came up with this

image.png.787240bffb2dfc662e54997d26be44e3.png

 

 

 

image.png

Edited by Liam mallka
Link to comment
Share on other sites

Link to post
Share on other sites

You can use CODE blocks here. Screenshots are harder to debug for us.

 

Anyway, here's a hint:

 

int max1 = 0;
int max2 = 0;

// ...

if (x > max1) max1 = x;
else if (x > max2) max2 = x;

 

The rest is left as an exercise to the reader.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Dat Guy said:

You can use CODE blocks here. Screenshots are harder to debug for us.

 

Anyway: What exactly requires our help? Looks like your code does what it should.

idk how to do the first max and second max like the output says

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×