#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void customerCreditLimit( double val=500) /*default parameter*/
{
printf("$%5.3f\n",val);
}
int main () /* main function*/
{
char s[128];
printf ("enter amount of credit or 'e' for default: ");
scanf("%s",s);
if ( strcmp(s,"e") == 0 )
customerCreditLimit(); /*print default value*/
else
customerCreditLimit(atof(s)); /*print user value*/
system ("pause");
return 0;
}
Comments
Leave a comment