fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. float grading(int Money);
  5.  
  6. int main() {
  7. int s;
  8.  
  9. printf ("how much your have ja: ");
  10. scanf("%d",&s);
  11. //ading(s);
  12. //a = grading(s);
  13. printf ("Net price in Main %.2f" , grading(s));
  14.  
  15.  
  16. }
  17.  
  18.  
  19.  
  20. float grading (int Money){
  21.  
  22. char Brand[30];
  23. char display_txt[50];
  24. int price = 0; float count =0, final = 0;
  25.  
  26. if (Money > 150){
  27. strcpy(Brand, "Fire Tiger");
  28. } else if (Money >= 120) {
  29. strcpy(Brand, "Tiger Sugar");
  30. } else if (Money >= 100) {
  31. strcpy(Brand, "Kyo Roll En");
  32. } else if (Money >= 80) {
  33. strcpy(Brand, "KOI The");
  34. } else if (Money >= 60) {
  35. strcpy(Brand, "KAMU TEA");
  36. } else if (Money >= 40) {
  37. strcpy(Brand, "FUKU Macha");
  38. } else if (Money >= 20) {
  39. strcpy(Brand, "Noob Cha");
  40. } else {
  41. printf("My lovely Friend, I need your help ei ei\n");
  42. return ;
  43. }
  44.  
  45. if (Money>=100){
  46. count = Money *0.15;
  47. }else if (Money>=60){
  48. count = Money *0.12;
  49. }else{
  50. count = 0;
  51. }
  52. final = Money - count;
  53.  
  54.  
  55.  
  56. printf("Brand: %s\n", Brand);
  57. printf("strupr()Brand : %s\n", strupr(Brand));
  58. printf("Reverse String : %s \n",strrev(Brand));
  59. printf("strlen() Brand %zu \n",strlen(Brand));
  60. printf("Net price: %.2f \n",final);
  61.  
  62.  
  63. return final;
  64. }
Success #stdin #stdout 0.04s 25520KB
stdin
Standard input is empty
stdout
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
float grading(int Money);

int main() {
int s;

printf ("how much your have ja: ");
scanf("%d",&s);
//ading(s);
//a = grading(s);
printf ("Net price in Main %.2f" ,  grading(s));


}



float grading (int Money){

char Brand[30];
char display_txt[50];
int price = 0; float count =0, final = 0;

    if (Money > 150){
        strcpy(Brand, "Fire Tiger");
    } else if (Money >= 120) {
        strcpy(Brand, "Tiger Sugar");
    } else if (Money >= 100) {
        strcpy(Brand, "Kyo Roll En");
    } else if (Money >= 80) {
        strcpy(Brand, "KOI The");
    } else if (Money >= 60) {
        strcpy(Brand, "KAMU TEA");
    } else if (Money >= 40) {
        strcpy(Brand, "FUKU Macha");
    } else if (Money >= 20) {
        strcpy(Brand, "Noob Cha");
    } else {
        printf("My lovely Friend, I need your help ei ei\n");
        return ;
    }
    
    if (Money>=100){
    	count = Money *0.15;
	}else if (Money>=60){
		count = Money *0.12;
	}else{
		count  = 0;
	}
	final = Money - count;
	
	
	
    printf("Brand: %s\n", Brand);
    printf("strupr()Brand : %s\n", strupr(Brand));
    printf("Reverse String : %s \n",strrev(Brand));
	printf("strlen() Brand %zu \n",strlen(Brand));
	printf("Net price: %.2f \n",final);
	

    return final;
}