Last active
July 18, 2019 18:24
-
-
Save sachinsaxena25/7453b04248c4ec0b21aff90ea0460fb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main(void){ | |
float principle_amount = 0.0f; | |
float time = 0.0f; | |
printf("please enter the principle_amount:\n"); | |
scanf("%f", &principle_amount); | |
printf("please enter the time duration:\n"); | |
scanf("%f", &time); | |
if(time > 10.0f) | |
printf("%.2f", principle_amount * time * 8.0f / 100.0f); | |
else | |
printf("%.2f", principle_amount * time * 12.0f / 100.0f); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
printf("%.2f", principle_amount * time * 8.0f / 100.0f);
andprintf("%.2f", principle_amount * time * 12.0f / 100.0f);