Can I take a look at your program?
Raiyan R.
asked 06/20/16i wrote a simple programme. the output was correct in my pc.but when i uploaded it to a wesite the output was different.would someone please tell me why?
the website is hackerrank.
and to one of the programmes my output on pc was
and to one of the programmes my output on pc was
3
4
0
0
4
but the same programme when uploaded yields
3
3
0
0
3
for the same test cases.i want to know aout the prolems.
Follow
3
Add comment
More
Report
2 Answers By Expert Tutors

David W. answered 06/20/16
Tutor
4.7
(90)
Experienced Prof
The issue you mention is called "portability."
For example, Java provides portability by compiling all Java source code into Java Byte Code to run on the JVM (Java Virtual Machine) that is tailored to the computer and operating system on which it is run. The JVM is standardized.
Often, computer languages differ on how they handle uninitialized variables, default variable size, and other computer language features. Also, there are various versions of languages. You may have noticed that Internet Explorer often produces different results than Firefox or Chrome.
HackerRank supports 15+ domains and 35+ languages. A typical PC supports only a few. Since you wrote a simple program, PLZ post it on this forum.
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.