Interesting Facts about C language

  • C is a general-purpose, imperative computer programming language.
  •  C is invented to write Operating system called UNIX 
  • We already familiar with C language right?? laugh
  • Then lets See... I am here to share some Interesting Facts In C Programming.
Some of these facts you may know alredy
  • Main is not compulsory
yyeyeayeahyeah uu hered right!! 
#include<stdio.h>
 #include BK m##a##i##n
 int BK()
 {
printf("SOOKSHMAS.");   
  }

It prints => SOOKSHMAS 

  • 2. We can use #include in any strange place enlightened
void main() 
{
 printf 
#include"next.c"
  }
And "next.c" contains :

      ("SOOKSHMAS!\n");

It gives output as SOOKSHMAS 

  • 3. A switch statement's case labels can occur inside if-else statements or in loops.i.e
switch (x)  {  case 1:; // ...
if (y==2)
      {
        case 2:;
        // ...
      }
 else case 3:
      {
        // ...

    for (b=0;b<10;b++)
        {
          case 4:;
          // ...
        }
      }
      break;
    case 5:
      // ...
      break;
}
  • 4.Argument index specification in printf format specifier :

  •  #include<stdio.>
    void main() 
     {
     printf("%4$d  %3$d  %2$d  %1$d ", 1, 2, 3,4);  
      }

      It will print as 4 3 2 1

  • 5. Ignoring input in scanf:

  • #include<stdio.h>
    void main()  
      {
      int a;
      scanf("%d",&a);
      printf("%d",a);    
       }

    When we excute thiz code it will not ask u any input instead it give '0' as output 

  • 6. '<:, :>, <%, %>' in place of '[, ], {, }',

  • Earlier years when it was hard to write '[, ], {, }', C actually accepted '<:, :>, <%, %>' respectively .

int main() <%

    int a <: 5 :>;
    a<:0:>=1;
printf("%d",a<:0:>);
   return 0;

%>

It prints output 1  Try it 

  • 7. a[index] is same as index[a]
     #include< stdio.h >
    
        int main() {
    
           int a[10];
    
           a[0]=1;
    printf("%d", 0[a] );
    
         return 0;     }

    It will gives output as 1 

 These are some interesting facts about C language 

Posted on by