Prof: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015 C Tutorial CIS5027
What is C? C is a structured, procedural programming language C has been widely used both for operating systems and applications It has become one of the most widely used programming languages of all time Many later languages have borrowed directly or indirectly from C,including C++C++, Java, JavaScript, C#, Perl, PHP, Python, …JavaJavaScriptC#PerlPHPPython
Main function in C Every full C program begins inside a function called "main“ A function is simply a collection of commands that do "something" The main function is always called when the program first executes From main, we can call other functions,
Simple Example To access the standard functions that comes with your compiler, you need to include a header with the #include directive
Variables in C There are several different types of variables: char int float
Arrays in C syntax for declaring an array: For example:
If statements in C
Loops in C Loops are used to repeat a block of code for while do … while
Functions in C functions are blocks of code that perform a number of pre-defined commands to accomplish something productive
Function example in C
C and C++Tutorial