How to write a C-program:
I'm using DevC++:
1.Open IDE(Integrated Development Environment):
2.File--->New----->Source File(Shortcut ctrl+N)
3.Type the Below Program
4.File--->save(choose the location where you want to save your c-programs)
give any filename.c
eg: Hello.c
5.compile the code Click on Execute---->compile(Shortcut F9)
6.Run the program click on execute----->Run(Shortcut F10)
program-1:
#include<stdio.h>int main()
{
printf("Hello guys!... This is my new program");
return 0;
}
Escape Sequences:
Escape sequence: These are special symbols used to escape the sequential order of execution.
These are shown with a backslash(\) followed by the respective character.
\n take the cursor to next line
\b backspace
\t tab space (8 character spaces)
\" double inverted comma(")
\\ shows a backslash on the console
\' single inverted comma(')
\a alert message(works only with speakers)
\n--------->new line
\t---------->tab space
\a---------->alert(which give some alert sound when you run the program)
\b--------->Back space
output without escape sequences
#include<stdio.h>
int main()
{
printf("Hello");
printf("krishna");
printf("thank you");
return 0;
}
output: Hellokrishnathank you
output with escape sequences
int main()
{
printf("Hello\n");
printf("krishna\t");
printf("thank you");
return 0;
}
output: Hello
Krishna thank you