To accomplish the affairs accepted the affairs itself care to ask the user to accumulation the ethics of p, n & r through the keyboard in the coursework of execution. This can be accomplished application a action alleged scanf( ). This action is a counter-part of the printf( ) function. printf( ) outputs the ethics to the awning admitting scanf( ) receives them from the keyboard. This is illustrated in the affairs apparent below:


/* Calculation of simple interest */
main()
{
int a, b;
float c, si ;
printf ( "Enter values of a, b, c" ) ;
scanf ( "%d %d %f", &a, &b, &c ) ;
si = (a * b * c )/ 100 ;
printf ( "%f" , si ) ;
}


0 comments to "PROGRAM USING SCANF() AND PRINTF()"

Post a Comment

Powered by Blogger.