# include<stdio.h>

main() { int n,year,choice=0; float val,tag,deprec; while(choice!=4) { printf("\nMethod:(1-Sl 2-DDB 3-SYD 4-END\n\n"); scanf("%d",&choice); if(choice >=1 && choice<=3) { printf("Original Value: "); scanf("%f",&val); printf("\nNo of years : "); scanf("%f",&n); } switch(choice){ { case 1: printf("\nStraight line method: \n\n"); deprec=val/n; val-=deprec; printf("\nEnd of the year %2d",year); printf(" \nDeprecation: %7.2f",deprec); printf(" \ncurrent value: %8.2f\n",val); }

``````    break;

case 2:
printf("\nDouble Decline Method: \n\n");
for(year=1;year<=n;++year){
deprec=2*val/2;
val-=deprec;
printf("\nEnd of the year %2d",year);
printf(" Deprecation %7.2f",deprec);
printf(" \ncurrent value: %8.2f",val);
}
break;
case 3:
printf("\nSum of Year:\n\n");
tag=val;
for(year=1;year<=n;++year){
deprec=(n-year+1)*tag/(n*(n+1)/2);
val-=deprec;
printf("\nEnd of the year %2d",year);
printf(" Deprecation %7.2f",deprec);
printf(" \ncurrent value: %8.2f",val);
}

break;
case 4:
printf("\nGoodbye !");
break;
default:
``````

} } }

suhel007
111

need help to solve this problem, the iteration is not working

(09 Jul '17, 14:22)

ভাই সম্পুর্ণ কোড টা ভালো করে লিখেন । এভাবে কোড লিখলে ভালো মতো বুঝা যায় না ।

(06 Aug '17, 21:05)
Be the first one to answer this question!
 toggle preview community wiki:

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__