"Z Code Writer" is an Online Blog for Programmer & Beginner. Here, You will Find tech, Build your Programming Skills and other Programming Language Like C, C++, HTML, Java Script Java Code, Web Designing and University Of Sialkot (USKT) CGPA / GPA Calculator etc.

Friday, 19 July 2019

The Scanf() Function

The Scanf() Function

      The scanf() function is used to get input from user through keyboard during execution of program. The values is input into variable in a specified format. This function can be used to get input into numeric, character and string type variables. This function is defined in the "stdio.h" header file.
      The general syntax of scanf() function is as follows;
                                 scanf ( format_string, variables ) ;


Example



#include < stdio.h >
#include < conio.h >
void main ( )
{
       char ch ;
       printf ( " Enter a Character  \n " ) ;
       scanf ( " %c " , &ch ) ;
       printf ( " Enter character is : %c " , ch ) ; 
}

No comments:

Post a Comment

Thanks For Visiting Here...!! I will Reply you as soon as possible.