Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program illustrates the use of scanf funtion

Posted By: Jessica Brown     Category: C Programming     Views: 8285

Write a Program illustrates the use of scanf funtion.

Code for Program illustrates the use of scanf funtion in C Programming

main()                                                       
   {                                                            
       int  number;                                             
                                                                
       printf("Enter an integer number\n");                     
       scanf ("%d", &number);                                   
                                                                
       if ( number < 100 )                                      
         printf("Your number is smaller than 100\n\n");        
       else                                                     
         printf("Your number contains more than two digits\n");
   }   
                                                         

Output                                                       
                                                                
   Enter an integer number                                      
   54                                                           
   Your number is smaller than 100                              
   Enter an integer number                                      
   108                                                          
   Your number contains more than two digits                    
  
Share: 


Didn't find what you were looking for? Find more on Program illustrates the use of scanf funtion Or get search suggestion and latest updates.

Jessica Brown
Jessica Brown author of Program illustrates the use of scanf funtion is from London, United Kingdom.
 
View All Articles

 
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!