Friday, January 21, 2011

Operators and Expressions

The cost of one type of mobile service is Rs. 250 plus Rs. 1.25 for each call made over and above 100
calls. Write a program to read customer codes and calls made and print
the bill for each customer.
#include<stdio.h>
#define ms 250
void main()
{
int custcode,x,n=0;
float call;
printf("Enter Customer code and calls made by him \n");
while(n<=100)
{
scanf("%d %d",&custocode,&x);
call=ms+1.25*(float)x;
n++;
printf("%d %f",custcode,call);
}
getch();
}

No comments:

Post a Comment