introduction to basic c programming 01

Download Introduction to Basic C programming 01

Post on 18-May-2015




6 download

Embed Size (px)


This presentation offers complete basic users a simple guide to the C programming Language.


  • 1. Introduction to C Workshop India Wilson Wingston Sharon

2. Writing the first program#includeint main(){ printf(Hello); return 0;} This program prints Hello on the screen when weexecute it 3. Header files The files that are specified in the include section iscalled as header file These are precompiled files that has some functionsdefined in them We can call those functions in our program bysupplying parameters Header file is given an extension .h C Source file is given an extension .c 4. Main function This is the entry point of a program When a file is executed, the start point is the mainfunction From main function the flow goes as per theprogrammers choice. There may or may not be other functions written byuser in a program Main function is compulsory for any c program 5. Comments in C Single line comment // (double slash) Termination of comment is by pressing enter key Multi line comment/*..*/This can span over to multiple lines 6. Data types in C Primitive data types int, float, double, char Aggregate data types Arrays come under this category Arrays can contain collection of int or float or char ordouble data User defined data types Structures and enum fall under this category. 7. Variables Variables are data that will keep on changing Declaration ;int a; Definition=;a=10; Usagea=a+1; //increments the value of a by 1 8. Operators Arithmetic (+,-,*,/,%) Relational (,=,==,!=) Logical (&&,||,!) Bitwise (&,|) Assignment (=) Compound assignment(+=,*=,-=,/=,%=,&=,|=) Shift (right shift >>, left shift


View more >