Pages

Wednesday, 20 September 2017

Input Output Statements in C ( printf() & scanf() ) #5





                I/O Statements :
                                The statement which are used to input some values or data in the program &
                                the statements which are used to output that values or data from the program are
                                known as Input/output statements.

                1] printf() :-
                                Header file = stdio.h
                                This function is used to display any data on output screen from the program.
                               
                                Syntax : printf(" formate specifiers " ,variable);

                * Formate specifiers :
                                These are used to output a specific data.
                                If you want to o/p integer data type value then you must need %d formate specifier.
                                for integer = %d
                                for float = %f
                                for character = %c

                                Ex. int i=8;
                                    printf(" i = %d ",i);

                                o/p : i = 8

                2] scanf() :-
                                Header file = stdio.h
                                This function is used to input any data in the program.
                               
                                Syntax : scanf(" formate specifiers ",& variable);

                                Ex. int i;
                                    scanf(" %d ",& i);

                                It will input the value well type on keyboard.



No comments:

Post a Comment