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 7964567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:55:15+00:00 2026-06-04T05:55:15+00:00

I have a c program #include <stdio.h> int main () { printf(Hello); } On

  • 0

I have a c program

#include <stdio.h>

int main ()
{
  printf("Hello");
}

On Windows:

I compile that program on windows and get a.exe

Now when I double-click on a.exe

Command windows opens

a.exe is run

and automatically close that windows.

To overcome this i have two solution

1> Create a batch file with the following content:

a.exe
pause

2> or add getch() function in my code

On LINUX

Now i want the same thing to happen in linux

I have compiled that program on linux get a.out and whenever i click on that nothing happens?

I have made one shell script:

#!/bin/bash

./a.out &

pause

and run that script by clicking on it but still nothing happened?


  • 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-06-04T05:55:16+00:00Added an answer on June 4, 2026 at 5:55 am

    The thing you’re not seeing is that it won’t open in anything at all; the program will just execute quietly in the background.

    To make the output visible, you’ll need to make a shell script to run the program in a terminal, which can be as simple as this:

    #!/bin/bash
    gnome-terminal -x "`dirname \"$0\"`"/a.out
    

    Mark the script as executable, and now you should be able to double-click it and see your program open in a terminal window. Note that tying the program to a particular terminal emulator (like gnome-terminal) is probably a bad idea, and you should rethink why you want this behaviour.

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

Sidebar

Related Questions

I have written a simple Hello World program. #include <stdio.h> int main() { printf(Hello
Say I have the following c program: #include <stdio.h> int main() { printf(Hello world
Here is my program: #include <stdio.h> int main(int argc, char **argv) { printf(hello world\n);
I have this program #include <stdio.h> int main() { char arr[100]; printf(%d, (int)sizeof(0,arr)); }
I have the following C program: #include <stdio.h> int main() { double x=0; double
Consider this program: #include <stdio.h> int main() { printf(%s\n, __FILE__); return 0; } Depending
I have a C file that looks like this: #include <stdio.h> int main(void) {
I have a program that prints UTF-8 string to the console: #include <stdio.h> int
I have a C Program: #include <stdio.h> int main(){ int b = 10; //assign
I have the following program #include <stdio.h> main() { char ch[10]; gets(ch); printf(\nTyped: %s\n\n,

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.