Points to be remember while writing c program
1) every programming instruction must be returned within a main block.
2)All the instructions must be returned in a lowercase, because she is a case sensitive language it knows the difference between lowercase and uppercase.
3) every statement must be ended with a semicolon (;).
4)we May write constant variable or any user-defined thing in capital.
Steps to save ,compile and execute the program
1) save: File->save (F2) i.e first.c
2) compile and execute:Ctrol+F9
Note: if getch () is not there, then we can see the output screen using alt+F5, else directly we can see the output.
Example:
Syntax
Main ()
{ Clrscr();
Printf("My first program in c.");
getch ();
}
Where
Clrscr (): used to clear the screen.
Printf (): to display the text o value of variable on the screen.
getch (): is used to hold output screen.
Escape Sequences: is used to move the cursor on the particular position
'\n'(newline) : is used to jump the cursor on the next line.
'\t'(tab) : to Move Cursor 5 characters along.
'\r'(carriage return):to move the cursor on the first character of the current line.
'\b'(backspace) : to jump the cursor one character left.
Thanks
ReplyDelete