Scanf( ) Return value
Info capacities:-
Scanf( ) is a library work that is utilized for input work. It return valuet depends on the either input esteem is right or not. On the off chance that esteem is right then it will return 1, else return 0. For instance in the event that you pronounce whole number esteem however your information is roast then it will indicate 0, Otherwise you input is number at that point it's arrival esteem 1. For this situation of Scanf( ) work Return esteem is either 0, 1 or EOF.
Return value of Scanf( ) function is clearly explain by following example program
PROGRAM:-
#include<stdio.h>
#include<conio.h>
void main ( )
{
int a , b ;
clrscr ();
a = 10 ; b = 2 ;
printf ( "The value of a and b is %d %d\n" , a , b );
printf ( "Addition of a , b is %d\n" , a + b );
printf ( "Subtraction of a , b is %d\n" , a - b );
printf ( "Mutiplication of a , b is %d\n" , a * b );
printf ( "Division of a , b is %d\n" , a / b );
printf ( "Modulo of a , b is %d\n" , a % b );
getch ( );
}
OUTPUT:-
Output
78
1
No comments:
Post a Comment