Variables in C

A variable is a temporary memory location that holds its data temporarily. C requires the data type of the variable to be well defined at the time of variable declaration, according on its value. Syntax: data_type variable_list; Rules for using C Variables: C Variable name starts with a letter or underscore only; numbers and special … Read more

Categories C

c printf and scanf

C printf() function: The printf() function is an inbuilt library function in C language, which is used for output, i.e, to print a given statement on the console. The printf() function is defined in stdio.h (header file) in C library. Syntax: printf(“format string”,argument_list); Format string: It is a mandatory parameter which takes value as Argument … Read more

Categories C

Flow of C Program

Execution Flow of C Program: Execution of a C Program is a step by step process which is discussed below. Preprocessors: Before compilation, the preprocessor starts processing the preprocessors directives first and generates an expanded source code. Assembly Code: The compiler than converts this expanded source code into an (.asm) assembly code. Object Code: After … Read more

Categories C

First C Program

Lets print “Hello C” as the first C program and than understand it in detail. #include <stdio.h>   void main() { printf ("Hello C!"); }#include <stdio.h> void main() { printf ("Hello C!"); } Output Hello C!Hello C! Description: #include <stdio.h> : “#include” is a preprocessor directive used to include a library file in the code. … Read more

Categories C

How to install C

How to install C: For executing a C file in a system, C compiler is a must. Various C compilers are available for downloading. Turbo C++ is among some common C compilers. Steps to install Turbo C++: Download Turbo C++ compiler. Create a directory inside the C drive. Extract the zip file inside Turbo C … Read more

Categories C

Features of C

Features of C: C is the most basic programming language and is among the first High level language which is user interactive as well as machine understandable in nature. Some other features of C are discussed below. FEATURES DESCRIPTION Extensible  C is extensible in the sense that it can easily accept and and can easily … Read more

Categories C

History of C Language

History of C Language: There were numerous programming languages that were developed before C language with an objective to overcome the tedious architecture of old languages. Dennis Ritchie in 1972 developed a more user friendly language at bell laboratories of AT&T (American Telephone & Telegraph), located in U.S.A. This language was considered as a High … Read more

Categories C

C program to print Fibonacci Triangle

The below program is to print the Fibonacci Triangle in C using loop. C program to print Fibonacci Triangle #include <stdio.h> #include<stdlib.h>   void main() { int i,j,k,m; int a= 0, b=2;   for(i=1; i<=5; i++) { printf("%d\t",b);   for(k=1; k<i; k++) { m=a+b; printf("%d\t",m); a=b; b=m; } printf("\n"); } }#include <stdio.h> #include<stdlib.h> void main() … Read more

Categories C

C program to print Number Triangle

The below program is to print the Number Triangle in C using loop. C program to print Number Triangle #include <stdio.h> #include<stdlib.h>   void main() { int i,j,k,m;   for(i=1; i<=5; i++) { for(j=5; j>=i; j–) printf(" ");   for(k=1; k<=i; k++) printf("%d",k);   for(m=1; m<i; m++) printf("%d",m); printf("\n"); } }#include <stdio.h> #include<stdlib.h> void main() … Read more

Categories C

C program to print Alphabet Triangle

The below program is to print the Alphabet Triangle in C using loop. C program to print Alphabet Triangle #include <stdio.h> #include<stdlib.h>   void main() { int alpha=97; int i,j,k,m;   for(i=1; i<=5; i++) { for(j=5; j>=i; j–) printf(" ");   for(k=1; k<=i; k++) printf("%c",alpha++); alpha–;   for(m=1; m<i; m++) printf("%c",–alpha); printf("\n"); alpha=97; } }#include … Read more

Categories C