Help needed to create the program

[FONT="]1. [/FONT]Write a complete program based on the following requirements.
In main( ) function: · Ask the user to enter 10 integer numbers.
· Determine the largest and smallest number among the 10 integer numbers.
· Display the largest and smallest integer
· Use a while(…) loop for this question.

[TABLE="class: MsoNormalTable"]
[TR]
[TD="width: 529"] [FONT="]Please enter 10 numbers[/FONT]
[FONT="]-----------------------[/FONT]
[FONT="] [/FONT]
[FONT="]Number 1 : 12[/FONT]
[FONT="]Number 2 : 5[/FONT]
[FONT="]Number 3 : 7[/FONT]
[FONT="]Number 4 : 8[/FONT]
[FONT="]Number 5 : 6[/FONT]
[FONT="]Number 6 : 18[/FONT]
[FONT="]Number 7 : 25[/FONT]
[FONT="]Number 8 : 35[/FONT]
[FONT="]Number 9 : 4[/FONT]
[FONT="]Number 10 : 19[/FONT]
[FONT="] [/FONT]
[FONT="]The largest number is 35[/FONT]
[FONT="]The smallest number is 4[/FONT]
[/TD]
[/TR]
[/TABLE]

Replies

  • Whats In Name
    Whats In Name
    Providing a direct solution will not help you further.I can explain you the working of the code,but you should yourself code it.

    -For inputting 10 numbers from the user,you should think of something which can store values of same datatype,you can use arrays for this.
    -Determining largest and smallest number can be solved by something related to comparisons.You can assume one number to be largest and then compare it with the next number and update the value for "largest".Do same for finding the smallest.
    -While loop will help you write a optimized code for comparison.

    Try it,if it not helps,you will be hinted more.
  • PraveenKumar Purushothaman
    PraveenKumar Purushothaman
    Yeah, the code is ready, an optimized one... Do try out your stuff. If not able to, I will post it... I used two variables here... 😀 And an array.. 😛

You are reading an archived discussion.

Related Posts

CEans, When at least half of us had not even decided what to do next after completing schooling, Marshall Haas was an entrepreneur already, at 17. He started his first...
Electronics engineers may pick up this idea for their third or final year project: Developing a smart bluetooth mouse. Computer mouse is an integral part of computer system and acts...
how do i design a 12V voltage regulator circuit using ic with current rating upto 45mA? which ic is most appropriate for this?
Adobe® Edge is a new web motion and interaction design tool that allows designers to bring animated content to websites, using web standards like HTML5, JavaScript, and CSS3. We might...
This is my thread to answer all generic questions commonly asked in Interviews (for both experienced and fresh graduates). I'm obviously not going to answer technical questions in this thread,...