Click here to Skip to main content
15,887,410 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
#include<stdio.h>
void main()
{
printf("hello");
}
this program done by me whats wrong in...............how to do ??????

What I have tried:

this code is tried by me.....i have tried the above codw as above
Posted
Updated 25-Feb-18 0:48am

Nothing.
That code compiles and runs fine: it produces an output - the word "hello" - and exits. Certainly according to my "internal" compiler it should, and an Online C Compiler[^] agrees with me.

If that is what you wanted it to do, then it does it very well.
If it isn't what you wanted it to do, you are going to have to think harder about the task you are trying to perform and code for that!

What makes you think it is wrong?
 
Share this answer
 
Most probably, you do not have time to see the message displayed since the program exits as soon as it has done its task.
Maybe you could try
C
int main() {
   printf("hello");
   system("pause");
}

which would allow you to actually see produced result.

Hope this helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900