C Tutorial

First C language Program

Lets see how to write a simple c program #include <stdio.h> #include <conio.h> int main() { printf(“Hello,World”); getch(); return 0; } Different parts of C program. Pre-processor Header file Function Variables expression Comment All these are essential parts of a C language program. Pre-processor #include, the first word of any C program. It is also …

First C language Program Read More »

C Input output function

C programming language provides many of the built-in functions to read given input and write data on screen, printer or in any file. scanf() and printf() functions #include<stdio.h> #include<conio.h> void main() { int i; printf(“Enter a value”); scanf(“%d”,&i); printf( “\nYou entered: %d”,i); getch(); } When you will compile the above code, it will ask you …

C Input output function Read More »

Operators in C Language

Operators are the foundation of any programming language. Thus the functionality of C language is incomplete without the use of operators. Operators allow us to perform different kinds of operations on operands. In C, operators in Can be categorized in following categories: Arithmetic Operators (+, -, *, /, %, post-increment, pre-increment, post-decrement, pre-decrement) Relational Operators (==, …

Operators in C Language Read More »

Decision making in C

Decision making is about deciding the order of execution of statements based on certain conditions or repeat a group of statements until certain specified conditions are met. C language handles decision-making by supporting the following statements, if statement switch statement conditional operator statement goto statement Decision making with if statement The if statement may be …

Decision making in C Read More »

Switch statement

Switch statement is used to solve multiple option type problems for menu like program, where one value is associated with each option. The expression in switch case evaluates to return an integral value, which is then compared to the values in different cases, where it matches that block of code is executed, if there is …

Switch statement Read More »

Arrays

In C language, arrays are reffered to as structured data types. An array is defined as finite ordered collection of homogenous data, stored in contiguous memory locations. Here the words, finite means data range must be defined. ordered means data must be stored in continuous memory addresses. homogenous means data must be of similar data …

Arrays Read More »

string and Character array

string is a sequence of characters that is treated as a single data item and terminated by null character ‘\0’. Remember that C language does not support strings as a data type. A string is actually one-dimensional array of characters in C language. These are often used to create meaningful and readable programs. For example …

string and Character array Read More »

Storage classes

In C language, each variable has a storage class which decides scope, visibility and lifetime of that variable. The following storage classes are most oftenly used in C programming, Automatic variables External variables Static variables Register variables Automatic variables A variable declared inside a function without any storage class specification, is by default an automatic …

Storage classes Read More »

Functions in c

A function is a block of code that performs a particular task. There are times when we need to write a particular block of code for more than once in our program. This may lead to bugs and irritation for the programmer. C language provides an approach in which you need to declare and define …

Functions in c Read More »