150 likes | 282 Views
C Programming. Computer Programming. process of designing, writing, testing , debugging , and maintaining the source code of computer programs… to create a set of instructions that computers use to perform specific operations or to exhibit desired behaviors…. Programming Language.
E N D
Computer Programming • process of designing, writing, testing , debugging , and maintaining the source code of computer programs… • to create a set of instructions that computers use to perform specific operations or to exhibit desired behaviors…
Programming Language • Artificial languagedesigned to communicate instructions to a machine, particularly a computer… • to create programsthat control the behavior of a machine and/or to express algorithmsprecisely…
Comments • Why to use comments…??? • Single Line comments : // type your comment here… • Multiline comments : between /* and */
“Hello World…!!!” /* This is your First program…!!! “Hello World…!!!” */ #include<stdio.h>int main(){printf("Hello World\n"); // to print the characters… return 0;}
Escape Sequence • Escape Sequences (series of characters) “\t” and “\n”
Today's Task 1. “Hello World…!!!” Program Use comments… Compile with –Wall option…
Today’s Task 2. Write a C Program to print your name in the given format : • Use printf() function to print the characters… • Use \n, \t and spaces to format your name…
Today’s Task • #include<stdio.h>void main () {printf("\n\n");printf("gggggg\n");printf("g g\n");printf("g \n");printf("gggg\n");printf("g g\n");printf("gggggg\n");printf("\n\n");}
Today’s Task • 3. Write a C Program to print the following line : \n and \t are the examples of escape sequences…!
Documentation • /****************************************************** Title :* Roll Number : * Description : * How to Compile :gccHelloWorld.c –Wall -o HelloWorld • * Date : *****************************************************/