You are not logged in. Please login at www.codechef.com to post your questions!

×

Life, the Universe, and Everything

include <iostream>

using namespace std; int main() { int n; while(1) { cin>>n; if(n>0 && n<100) { if(n==42) break; else cout<<n<<endl; } else break; } // your code goes here return 0; } why I am getting wrong answer while submitting can any one explain

asked 16 Dec '18, 10:12

kavitha12345's gravatar image

0★kavitha12345
1
accept rate: 0%


There is no need to check for any conditions on n, firstly. Secondly, you also need to change lines after every output.

link

answered 17 Dec '18, 17:15

anushkaaa's gravatar image

2★anushkaaa
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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:

×332
×184

question asked: 16 Dec '18, 10:12

question was seen: 95 times

last updated: 17 Dec '18, 20:29