×

# Why giving wrong answer ? Max and min problem

 0 Do not print any messages like "Give N" .You should only print the output of the program. Please provide the link of the question if you still face any difficulty. Happy Coding!!! answered 04 Jan '15, 19:40 4★the65bit 1.1k●10●13●28 accept rate: 13% I have written the question in above comment. After removing , "Give N" again it produces any garbage value. (05 Jan '15, 18:17) Please provide link to question where you are trying to submit the solution. (05 Jan '15, 18:35) the65bit4★ I am studying from nptel.ac.in . It is website maintained by govt of India and contains courses from IIT's. I am on course of Programming and Data Structures. In the course it is being explained how to reduce time by making program efficient. The goal of this lecture is to find out the maximum and minimum of given N numbers. That is on first line a number N will be taken as input and than N lines containing integers. Out of those N numbers you have to find the maximum and minimum among them. The code is giving wrong answer on my computer but giving correct output on the proffesor's computer. (06 Jan '15, 12:23) The link to lecture is- nptel.ac.in/courses/106105085/6 You can have a look at it if you want. Help will be really appericiated. (06 Jan '15, 12:25)
 0 As @the65bit says, it is like Sgt. Joe Friday says in Dragnet ... "Only the facts, Ma'am." The Online Judge compares your output to the "correct answer output" and if there is any non-whitespace difference, then it is wrong. Any debug or testing output must be removed prior to the Submit. answered 05 Jan '15, 02:29 2★xyzzy529 11●1●3 accept rate: 0% I am not testing it on any online judge. I am testing it on my own computers and answer produced are not even given as input ie any garbage value is returned as output. You may try it on your compiler. Please help!! (05 Jan '15, 18:19)
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×26
×11

question asked: 04 Jan '15, 17:57

question was seen: 553 times

last updated: 20 Mar '18, 14:44