View Code of Problem 70

#include <stdio.h>
int main()
{
	int x,sum;
  	scanf("%d",&n);
  	if(x<=100000)
          sum=x*0.1;
  	else if(x<=200000)
          sum=10000+(x-100000)*0.075;
        else if(x<=400000)
          sum=10000+7500+(x-200000)*0.05;
        else if(x<=600000)
          sum=10000+7500+10000+(x-400000)*0.03;
        else if(x<=1000000)
          sum=10000+7500+10000+60000+(x-600000)*0.15;
        else
          sum=10000+7500+10000+60000+400000*0.015+(x-1000000)*0.01;
          printf("%d",sum);
          
 
 
 
 
}
/*
Main.c: In function 'main':
Main.c:5:16: error: 'n' undeclared (first use in this function)
    scanf("%d",&n);
                ^
Main.c:5:16: note: each undeclared identifier is reported only once for each function it appears in
*/

Double click to view unformatted code.


Back to problem 70