C programming tutorial; Through this tutorial, you will learn c programming with examples.
C language is a popular and widely used Programming language and The origin of C is closely tied to the development of the Unix operating system, originally implemented in assembly language on a PDP-7 by Dennis Ritchie and Ken Thompson, incorporating several ideas from colleagues. Eventually, they decided to port the operating system to a PDP-11.
C Programming Language Tutorial
- C Basics
- C Programming Operators
- C Tutorial on Decision Making Statements
- C Programming Loops tutorial
- Arrays In C
- C programming tutorial on Structures
- Pointers in C
- C Files Function
- C programming Functions Tutorial
- C Built-in Library Functions
- C String Functions
- C Math Functions
- C Programming Examples
C Basic
In basic of c programming language; you will learn the following; as shown below:
- Turbo C++ installation
- First C Hello World Program
- C Keywords and Identifiers
- Comments
- Escape Sequence
C Programming Operators
The following are the list of operators available in the C Programming Language:
- Arithmetic Operators
- Relational Operators
- Logical Operators
- Assignment Operators
- Increment & Decrement Operators
- Conditional Operator
- Bitwise Operators
- Sizeof Operator
C Tutorial on Decision Making Statements
The following are the list of decision making statements in the C Programming Language:
- If Statement
- If Else Statement
- Else If Statement
- Nested If Statement
- Break Statement
- Continue Statement
- Goto Statement
- Switch Statement
C Programming Loops tutorial
In C Programming, three loops for, while and do while loops; as shown below in list:
Arrays In C
Arrays are a collection of values with the same data type. C supports one-dimensional arrays, two and multi-dimensional arrays.
C programming tutorial on Structures
- Structure Introduction
- Structures and Functions
- Array of Structures
- Union
- Difference between Structure and Union
Pointers in C
C Files Function
The following are the list of C programming functions that support the Files operations. You can use them to perform the required file operation.
- Gets
- fputc – Write Character to File
- fputs – Write String Data to File
- fgetc – Read Character from File
- fgets – Read String Data from File
C programming Functions Tutorial
Functions introduction, types, and recursive functions in c programming; as shown below list:
- Function
- Pass Array to the function
- Pass Pointers to Functions
- Types of User Defined Function
- Recursion
C Built-in Library Functions
There are built-in library functions in c programming; as shown below list:
C Header Files | Description |
---|---|
<assert.h> | Program assertion functions |
<ctype.h> | Character type functions |
<locale.h> | Localization functions |
<math.h> | Mathematics functions |
<setjmp.h> | Jump functions |
<signal.h> | Signal handling functions |
<stdarg.h> | Variable arguments handling functions |
<stdio.h> | Standard Input/Output functions |
<stdlib.h> | Standard Utility functions |
<string.h> | String handling functions |
<time.h> | Date time functions |
C String Functions
The following are the list of String functions available in C programming; as shown below in list:
Function | Syntax (or) Example | Description |
---|---|---|
strcpy() | strcpy(string1, string2) | Copies string2 value into string1 |
strncpy() | strncpy(string1, string2, 5) | Copies first 5 characters string2 into string1 |
strlen() | strlen(string1) | returns total number of characters in string1 |
strcat() | strcat(string1,string2) | Appends string2 to string1 |
strncat() | strncpy(string1, string2, 4) | Appends first 4 characters of string2 to string1 |
strcmp() | strcmp(string1, string2) | Returns 0 if string1 and string2 are the same; less than 0 if string1<string2; greater than 0 if string1>string2 |
strncmp() | strncmp(string1, string2, 4) | Compares first 4 characters of both string1 and string2 |
strcmpi() | strcmpi(string1,string2) | Compares two strings, string1 and string2 by ignoring case (upper or lower) |
stricmp() | stricmp(string1, string2) | Compares two strings, string1 and string2 by ignoring case (similar to strcmpi()) |
strlwr() | strlwr(string1) | Converts all the characters of string1 to lower case. |
strupr() | strupr(string1) | Converts all the characters of string1 to upper case. |
strdup() | string1 = strdup(string2) | Duplicated value of string2 is assigned to string1 |
strchr() | strchr(string1, ‘b’) | Returns a pointer to the first occurrence of character ‘b’ in string1 |
strrchr() | ‘strrchr(string1, ‘b’) | Returns a pointer to the last occurrence of character ‘b’ in string1 |
strstr() | strstr(string1, string2) | Returns a pointer to the first occurrence of string2 in string1 |
strset() | strset(string1, ‘B’) | Sets all the characters of string1 to given character ‘B’. |
strnset() | strnset(string1, ‘B’, 5) | Sets the first 5 characters of string1 to the given character ‘B’. |
strrev() | strrev(string1) | It reverses the value of string1 |
C Math Functions
The following are the list of math functions available in C programming; as shown below in list:
Function | Description |
floor ( ) | This function returns the nearest integer which is less than or equal to the argument passed to this function. |
round ( ) | This function returns the nearest integer value of the float/double/long double argument passed to this function. If decimal value is from “.1 to .5”, it returns integer value less than the argument. If decimal value is from “.6 to .9”, it returns the integer value greater than the argument. |
ceil ( ) | This function returns nearest integer value which is greater than or equal to the argument passed to this function. |
sin ( ) | This function is used to calculate sine value. |
cos ( ) | This function is used to calculate cosine. |
cosh ( ) | This function is used to calculate hyperbolic cosine. |
exp ( ) | This function is used to calculate the exponential “e” to the xth power. |
tan ( ) | This function is used to calculate tangent. |
tanh ( ) | This function is used to calculate hyperbolic tangent. |
sinh ( ) | This function is used to calculate hyperbolic sine. |
log ( ) | This function is used to calculates natural logarithm. |
log10 ( ) | This function is used to calculates base 10 logarithm. |
sqrt ( ) | This function is used to find square root of the argument passed to this function. |
pow ( ) | This is used to find the power of the given number. |
trunc.(.) | This function truncates the decimal value from floating point value and returns integer value. |
C Programming Examples
There are list of c program examples; as shown below in list: