Welcome to LetMe-C:)

rss

Saturday, March 6, 2010

PROGRAM USING ESCAPE SEQUENCES



Make a program which displays the following output:

HELLO
WORLD

#include
#include
void main (void)
{printf("HELLO\n");
printf ("WORLD");
getche();
}

Introduction to Escape sequences

I am now introducing two escape sequences:

1. \n (FOR ENTER)
2. \t (TAB)

\n or Backslash n is used in place to change the line in a program.
\t or Backslash t is used to give 8 character spaces.

YOUR FIRST PROGRAM



Please try this program:
#include
#include "These are known as HEADER FILES"
void main (void)
{printf("Hello World"); "YOUR PROGRAM"
getche(); "Here this command works as (Press any key to continue)"
}

NOTE: PLEASE TAKE CARE OF SYNTAX (GRAMMAR OF THIS PROGRAM)

1) TYPE THIS PROGRAM
2) COMPILE YOUR PROGRAM
3) RUN YOUR PROGRAM.

Run your program



If there are no errors after compilation you will run your program.
You can find RUN in the DEBUG pull down menu or you can use CTRL + F9 as a shortcut.
After this a DOS window will appear with your program.

Compile



You will find the COMPILE under the PROJECT pull down menu.
After you have written any program. This command will translate your program and show errors or warnings (if any) in the message box.
You can also use ALT + F9 as a shortcut.

After Clicking the Message



After clicking the Message a window will appear. This is where you will get any kind of errors (hopefully not) and messages about your program.

Message Window



Go to VIEW in the pull down menu
Click MESSAGE.