10-15-2009, 08:37 AM
10-15-2009, 02:38 PM
Code:
#include <stdio.h>
int main(void) {
printf("Hello World!\n");
return 0;
}Good enough?
10-24-2009, 02:19 AM
Hi dude,
You can use puts or fputs:
int puts( char *str );
int fputs( const char *str, FILE *stream );
Here is a small example compiled on my Solaris 9 box:
** Edit ** Please use code tags
You can use puts or fputs:
int puts( char *str );
int fputs( const char *str, FILE *stream );
Here is a small example compiled on my Solaris 9 box:
Code:
#include <stdio.h>
int main()
{
puts("Hello World\n");
fputs("Hello World 2\n", stdout);
}** Edit ** Please use code tags
12-21-2009, 11:28 PM
I have a another way to print a message on screen without ; in the program
what do you say about this?
Code:
if(printf("Hello"))
{
}what do you say about this?
12-21-2009, 11:35 PM
Quote:what do you say about this?Sure does look like the easiest way, but is it reliable?

12-22-2009, 03:01 AM
It's silly to have a conditional if on printf, just to remove the semi colon.
The semi colon indicates the end of line in C. Why on earth would you code around that?!
The semi colon indicates the end of line in C. Why on earth would you code around that?!
09-07-2010, 03:36 AM
hello....
Code:
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf(");
scanf(");
getch();
}09-07-2010, 09:53 PM
Horribly wrong...
#1 : Avoid using conio.h as it isn't a standard (& therefor non-portable) header
#2 : void main is the devil. Letting the compiler correct things you don't know or understand is a horrible way to program. Use int main always, always! Letting the OS know the program exited cleanly (with return 0) is both being a good coder, & also cleaning up after your mess. It's a great habit to get into. Use compiler correction as a crutch, & it will burn you one day.
#1 : Avoid using conio.h as it isn't a standard (& therefor non-portable) header
#2 : void main is the devil. Letting the compiler correct things you don't know or understand is a horrible way to program. Use int main always, always! Letting the OS know the program exited cleanly (with return 0) is both being a good coder, & also cleaning up after your mess. It's a great habit to get into. Use compiler correction as a crutch, & it will burn you one day.
09-08-2010, 05:28 AM
Hi
Very true. what is the need for using if statement?
Regards
Very true. what is the need for using if statement?
Regards
09-08-2010, 06:30 AM
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,v....
printf("enter the value");
scanf(");
getch();
}
#include<conio.h>
void main()
{
clrscr();
int a,b,v....
printf("enter the value");
scanf(");
getch();
}
11-23-2010, 09:03 AM
I do not know that how "hello" print in the C language without Printf.
#include <stdio.h>
int main(void)
{
printf("Hello World! \n");
return (0);
Getch();
}
#include <stdio.h>
int main(void)
{
printf("Hello World! \n");
return (0);
Getch();
}
05-20-2011, 01:22 PM
#include<stdio.h>
#include<conio.h>
void main()
{
string str="Hello";
scanf(%s,&str);
getch();
}
#include<conio.h>
void main()
{
string str="Hello";
scanf(%s,&str);
getch();
}
05-23-2011, 03:12 AM
(09-08-2010 06:30 AM)Fletcherr Wrote: [ -> ]#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,v....
printf("enter the value");
scanf(");
getch();
}
You are right because i have been read this type of concept.
05-23-2011, 03:33 AM
Nothing says "informal coding" like void main & a lack of proper indenting.
05-24-2011, 02:56 AM
(05-23-2011 03:33 AM)no2pencil Wrote: [ -> ]Nothing says "informal coding" like void main & a lack of proper indenting.
Can you explain something about "informal coding"?