Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » BeginnersRSS Feeds

Program illustrates the output of integer numbers under various formats

Posted By: Bin Fischer     Category: C Programming     Views: 2521

Program illustrates the output of integer numbers under various formats.

Code for Program illustrates the output of integer numbers under various formats in C Programming

   main()                                                      
   {                                                           
       int m = 12345;                                          
       long n = 987654;                                        
                                                               
       printf("%d\n",m);                                       
       printf("%10d\n",m);                                     
       printf("%010d\n",m);                                    
       printf("%-10d\n",m);                                    
       printf("%10ld\n",n);                                    
       printf("%10ld\n",-n);                                   
   } 

Output                                                      
                                                               
   12345                                                       
        12345                                                  
   0000012345                                                  
   12345                                                       
       987654                                                  
      -987654                                                  
  
Share: 



Bin Fischer
Bin Fischer author of Program illustrates the output of integer numbers under various formats is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!