Month: May 2017

17
May
2017

Function ODD EVEN

Problem From: 101cproblems #include<stdio.h> int func(int a) { if(a%2==0) return 1; return 0; } int main() {…

17
May
2017

Register in Storage Class

code: #include<stdio.h> int main() { register int count; for(count=1;count<=1000;count++) { printf(“%d\n”,count); } // int countn; // for(countn=1;countn<=1000;countn++)…

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

Fibonacci in C with Recursion

code from 1: #include<stdio.h> long getFibbTerm(int t) { if(t==1||t==2) return 1; return getFibbTerm(t-1)+getFibbTerm(t-2); } int main() {…

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…