WRITE YOUR OWN PREHEADER FLIE

          WRITE YOUR OWN PREHEADER FLIE 



what is preheader file also called own library  where you call technically preprocessor  it will always declaring top of program


advantages


1.Fast program executed and you rewrite program again and again 
2.It will remove complexity of problem 


NOTE:

before knowing the how to write your own headerflie you must about functions types with knowing that concept you cannot understand


   This is header file must save with .h formate



This main program




// C program to illustrate the concept of Line splicing.

int main()
{
 // Line Splicing\
 printf("welcome WORLD\a");
 return (0);
}


escape  operators 

\a    Alarm or Beep  
\b    Backspace
\f    Form Feed
\n    New Line
\r    Carriage Return
\t    Tab (Horizontal)
\v    Vertical Tab
\\    Backslash
\'    Single Quote
\"    Double Quote
\?    Question Mark
\ooo  octal number
\xhh  hexadecimal number
\0    Null



extern function example 



int a=12;
int main()
{
printf("%d",a);
}
extern int a;
int my function ()
{
printf("%d",a);
}
 

print n number with out using semi clone

int main(int num)
{
//where frist the of num=0 recursion start bade function and return to null charcter
if((num<=10)&&printf("%d",num)&&main(num+1))
{}
}

add with out addtion operater


int main(int a,int b )
{
printf("%*c%*c",a,'',b,'');
   or
printf("%*c%*c",a,'/r',b,'/r');
here simple logic that is (,' ',)= + the 2 spaces valie equal to addtion
}
int sumDigits(int no)
{
return no == 0 ? 0 : no%10 + sumDigits(no/10) ;
}
int main(void)
{
 printf("%d", sumDigits(687));
 return 0;
}

Comments

Popular posts from this blog

circular linked list

calendar program odd days method

C in Depth