Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7519605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:55:56+00:00 2026-05-30T01:55:56+00:00

Beginner hobby programmer here. I’m used to running C in OSX compiling with GCC

  • 0

Beginner hobby programmer here. I’m used to running C in OSX compiling with GCC but I recently had to switch to windows. I’m compiling my code using Microsoft visual studio express 2010. The compiling goes fine but after that when I try to run it it only flashes open for a millisecond and then closes. How do I fix this?

This happens to all of the scripts I have tried but here is one in particular, the classic Fahrenheit and Celsius converter from K&R, that does not work.
If this is a stupid question, sorry. Just started learning C two weeks ago.

 #include <stdio.h>

    main()
   {
     int fahr, celsius;
     int lower, upper, step;
     lower = 0;     
     upper = 300;    
     step = 20;    
     fahr = lower;
     while (fahr <= upper) {
         celsius = 5 * (fahr-32) / 9;
         printf("%d\t%d\n", fahr, celsius);
         fahr = fahr + step;
      }
   }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:55:56+00:00Added an answer on May 30, 2026 at 1:55 am

    put a getch() before your final brace }, this will require a keypress before the program exits

    the only reason I suggest this rather than ctrl-f5 is that it teaches you another C command 🙂

    [edit]
    Let me add a little more information to what you’re doing.

    The correct signature for main is int main(int argc, char **argv), this is the value you should have in your program (to replace the single line main() that is currently there.

    You don’t have to do anything with those variables (argc & argv), they may be unused by you, the programmer. However, the presence of the preceding int on the function name (main) means that it is expected to return a value. Again, you probably don’t care. However, in the future, you or someone who is responsible for your code, will care. What this means is that your main function should return some value, something to indicate it’s success or failure to the underlying operating system (also, something to be used should you employ your programs in a shell script).

    For the time being, a simple return(0), after the aforementioned getch() will do the job nicely.
    [/edit]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Once again a very beginner-ish question, but here I go: I would like to
Beginner programmer here....hope it makes sense :) I have created a console app that
Beginner question here. I'm going to make a Jquery function that is used to
MySQL beginner here. I had thought that copying the directory <mysql_path>/<data_base_name> to USB stick
Beginner programmer here. So bear with me. I have a simple python program. print
Beginner programmer here. after a bunch of reading about 'variables' which dont exist in
I'm not a beginner at C# but I really need to increase my understanding,
Beginner here. Why is this an endless loop ? for (p = 0; p
Beginner here! Forgive me in advance for raising what is probably an incredibly simple
Beginner here: In this answer to my question of how to insert data into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.