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 »

Keywords In C Programming Language

Keywords are preserved words that have special meaning in C language. The meaning has already been described. These meaning cannot be changed. There are total 32 keywords in C language. auto double int struct break else long switch case enum register typedef const extern return union char float short unsigned continue for signed volatile default …

Keywords In C Programming Language 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 »

How to use Loops in C Lanugage

n any programming language, loops are used to execute a set of statements repeatedly until a particular condition is satisfied. How it Works A sequence of statements are executed until a specified condition is true. This sequence of statements to be executed is kept inside the curly braces { } known as the Loop body. …

How to use Loops in C Lanugage 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 »

Types of Function calls in C

Functions are called by their names. If the function is without argument, it can be called directly using its name. But for functions with arguments, we have two ways to call them, Call by Value Call by Reference Call by Value In this calling technique we pass the values of arguments which are stored or …

Types of Function calls in C Read More »

Passing Array to Function

Whenever we need to pass a list of elements as argument to the function, it is prefered to do so using an array. But how can we pass an array as argument ? Lets see how to do it. Declaring Function with array in parameter list There are two possible ways to do so, one …

Passing Array to Function Read More »

typedef In C Programming Language

typedef is a keyword used in C language to assign alternative names to existing types. Its mostly used with user defined data types, when names of data types get slightly complicated. Following is the general syntax for using typedef, typedef existing_name alias_name Lets take an example and see how typedef actually works. typedef unsigned long …

typedef In C Programming Language Read More »

Scroll to Top