Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

shubham Group Title

Unable to compile/run a program under MS's visual studio c++ 2010.... #include<stdio.h> int main() { int p,n; float r,si; p=1000; n=3; r=8.5; si=p*n*r/100; printf("%f/n" ,si); return 0; } when tried to run (Ctrl F5), the black screen appears with ''255.000000/n Press any key to continue'' instruction and suddenly disappears when any key is pressed..

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. shubham Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Also debugging (F5) it produces a screen which disappears within a sec.

    • 2 years ago
  2. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    It sounds like your program is actually running. Although, you should change the "/n" to a "\n" in your printf.

    • 2 years ago
  3. shubham Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    yea.. but the output screen doesn't stays for me to input values and see results...

    • 2 years ago
  4. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    Ah, right, so that's because you don't have any functions that take input... hold on one sec....

    • 2 years ago
  5. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    Look at this: http://www.cplusplus.com/reference/clibrary/cstdio/gets/ :)

    • 2 years ago
  6. shubham Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    so can you please write a simple c++ program which I may copy paste that give results...

    • 2 years ago
  7. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    Well, I'll show you an example program. So gets() reads a string from the input. So you'll want to provide some sort of prompt with printf. So, printf("Enter a number: "); Then you'll want to retrieve a number with gets... char number[5]; gets( &number ); Then you'll want to change that to an integer, which should look something like... int numberInteger = atoi(number) You'll still have some stuff to fill in, but after it's a number you'll be able to use it in calculations. Make sense?

    • 2 years ago
  8. shubham Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    This is the error message I get at the end of output The program '[5700] 55.exe: Native' has exited with code 0 (0x0). in both situations.

    • 2 years ago
  9. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    The code I provided doesn't do everything you need it to do. You need to take the pieces I gave you and stitch them into your program.

    • 2 years ago
  10. shubham Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    yes, I did and with several other programs which do run on TC compiler...

    • 2 years ago
  11. farmdawgnation Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    Well, exited with code 0 means the program quit normally. I don't know what else to say. I'm not much use with the Visual Studio world. I exist mostly in the GCC world.

    • 2 years ago
  12. shubham Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    BTW thank you ...

    • 2 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.