Category: A ll Codes

10
May
2017

For Loop Tricks

For Loop Tricks: #include<stdio.h> int main() { int i; i=1; for(printf(“Hi\n”);i<=5;printf(“Dave\n”)){ printf(“Hello World\n”); i++; } return 0;…

10
May
2017

While Loop Tricks :D

code: #include<stdio.h> int main() { int i=1; while(i<=printf(“Hi\n”)){ printf(“Hello\n”); i++; } printf(“%d\n”,i); return 0; } output: Hi…

09
May
2017

Leap Year Returned :P

code: #include<stdio.h> int main() { int year,x; printf(“Enter year:”); scanf(“%d”,&year); //((year%4==0&&year%100!=0)||(year%400==0))?:printf(“%d is not leap year.”,year); x=((year%4==0&&year%100!=0)||(year%400==0))?1:0; if(x==0)…

09
May
2017

Ternary in C

code: #include<stdio.h> int main() { int a=20,b=50,c=40,m; // if(a>b && a>c) // m=a; // else if(b>c) //…

09
May
2017

C if else techniques

code: #include<stdio.h> int main(){ if(!printf(“Hello”)){ printf(” world\n”); }else{ printf(” Hell!”); } return 0; }  

08
May
2017

Short Circuit Feature For Logical Operators

code: #include<stdio.h> int main() { int a=-1,b=10,c; c=++a && ++b; printf(“a=%d, b=%d, c=%d\n”,a,b,c); return 0; } Expected…