Home > C Programming Language And Data Structures

Array In C Programming

Array In C Programming Is A Collection Of Data Items All Of Same Type. Access Using A Common Name.   Advantages Code Optimization  Less code To Access The Data Easy To Travells Data By Using For Loop We Can Retrieve The Elements Of Array Easily Easy To Sort Data To Sort The Elements Of Array We Need Few Lines

Read More

Storage Classes In C

Storage Classes In C Are Used To Define Scope And Lifetime Of Our Variable. Storage Class Storage Place Default Value Scope Lifetime Auto RAM Garbage Value Local Within The Function Static RAM Zero Local Till The End Of Main Program, Retains The Value Between Multiple Function Calls. Register Register Garbage Value Local Within The Function   Register Variable The Register Variable Allocates Memory In The Register Than RAM Its Size Of Register Size. It Has

Read More

Recursion

When The Function Is Called Within The Same Function, It Is Known As Recursion. The Function Which Calls The Same Function Is Known As Recursion. A Function That Calls Itself And Doesn't Perform Any Task After Calling Function,It Is Called As TailRecursion. In TailRecursion We Generally Call The Same Function With return

Read More

Function In C Language

Function In C Is Also Also Known As Procedure Or Subroutine In Other Programming Languages. To Perform Any Task We Can Create Function In C. A Function Can Be Called Many times. It Provides Modularity And Code reusability.   Advantages Of Functions Code reusability - By Creating Function In C We Can Call It

Read More

Call By Value And Call By Reference

Call By Value And Call By Reference Are Two Ways To Pass The Value (Or) Data To The Function In C Language. Call By Value Call By Reference  The Original Value Is Not Modified In The " Call By Value "  But The Original Value Is Is Modified In The Call

Read More

Day 13 - Types Of Variables : Variables In C

The Following Are The Types Of  Variables In C Language. Local Variable Global Variable Static Variable Automatic Variable Local Variable  We Will Write int, float, In The Place Of 'void' 'void' is returntype which is of empty space. we will declare local variable inside the function or block ends with return 0; Example  All The Programs I Explained

Read More

Day 12: Type Casting in c

Type Casting in c Allows Us To Convert On Data Type To Another Data Type. We Use Cast Operator For Type Casting Which Is Donated By (type) Syntax (data type)value; Note : It Is Always Recommended To Convert Lower Value To Higher Value To Avoid Data Loss. #include<stdio.h> #include<conio.h> void main() { float f=(float)9/4;     printf("F = %f ",f); getch(); }   Result F = 2.250000 

Read More

Day 11: goto statement in c

goto statement in c Is Also Known As Jump Statement. It Is Used To Unconditionally Jump To Other Label. It Transfers Control To Other Parts Of Program. We Are Using Labels In This Concept. Example Program To Verify Whether The Voter Is Eligible To Vote Or Not. #include<stdio.h> #include<conio.h> voidmain() { int age; char c; clrscr(); check:     // Label // printf("Enter Your Age:

Read More

Day 10 : Continue Statement In C

Continue Statement In C Is Used To Continue The Execution Of The Loop(while,dowhile and for).It Is Used With If Condition With In The Loop. Example - One Table Using Continue Statement (with single number) #include<stdio.h> #include<conio.h> voidmain() { int i; clrscr(); for(i=1;i<=10;i++) { if(i===5) { continue; } printf("%d\n",i); } getch(); } Result 1 2 3 4 ------Continued 5 6 7 8 9 10   Difference Between Break Statement In C And Continue Statements In C Is, Break Break's The Execution Of The

Read More

Break Statement

Break Statement Is Used To Break The Execution Of The Loop(while,dowhile,for) And Switch Case. #include<stdio.h> #include<conio.h> voidmain() { int i; clrscr(); for(i=1;i<=10;i++) { printf("%d\n",i); if(i==5) { break; } } getch(); } Result 1 2 3 4 5 Break Break Statement With Inner Loop #include<stdio.h> #include<conio.h> voidmain() { int i,j; clrscr(); for(i=1;i<=3;j++) { printf("%d\t%d\n",i,j); if(i==2&&j==2) { break; } } } getch(); } Result 1     1 2     2 Break    

Read More