Category: C

17
May
2017

Extern Keyword in Storage Class for C

code: #include<stdio.h> void test(){ extern int gVar; printf(“gVar=%d\n”,gVar); gVar=270; } int gVar; int main() { printf(“gVar=%d\n”,gVar); gVar=10;…

16
May
2017

Storage Class

From udemy c for technical interview vid: Static and Auto: #include<stdio.h> void test1(){ auto int k; printf(“k=%d\n”,k);…

16
May
2017

Tower of Hanoi Recursion

code: #include<stdio.h> void toh(int n,int source,int aux,int dest) { if(n==1){ //just pick and place printf(“move the disk…

14
May
2017

When We Need Recursion ?

When we don’t need any explicit stacks then we need recursion: #include<stdio.h> void decToBin(unsigned int n){ if(n==1)…

14
May
2017

Recursion in C

code: #include<stdio.h> void printNo(unsigned int n) { if(n==0) return; //it is outing from this function and going…

13
May
2017

Recursion Example

code: #include<stdio.h> void printMsg(unsigned int n) { if(n==0) return; //when we are using return in void function…