<mosaic.cnfolio.com>
PROGRAM
  1. #include <stdio.h>
  2. #include<stdlib.h>
  3. #include<time.h>
  4. int main()
  5. {
  6. double cash1=0;
  7. double cash2=0;
  8. double cash3=0;
  9. double cash4=0;
  10. int gainloss1=0;
  11. int gainloss2=0;
  12. int gainloss3=0;
  13. int gainloss4=0;
  14. int cashwon1=0;
  15. int cashwon2=0;
  16. int cashwon3=0;
  17. int cashwon4=0;
  18. int betno1=0;
  19. int betno2=0;
  20. int betno3=0;
  21. int betno4=0;
  22. srand(time(NULL));;
  23. int s = rand()%38;
  24. if(s == 37)
  25.  {
  26.  s =00;
  27.  }
  28. printf("******Hello! Welcome to this lovely casino******\nPlease enter your 4 bets and the amounts for each one\n");
  29. scanf("%lf",&cash1);
  30. scanf("%d",&betno1);
  31. scanf("%lf",&cash2);
  32. scanf("%lf",&betno2);
  33. scanf("%lf",&cash3);
  34. scanf("%lf",&betno3);
  35. scanf("%lf",&cash4);
  36. scanf("%lf",&betno4);
  37. printf("The bet number that won is %d\n", s);
  38. if((betno1<=0) || (betno2<=0) || (betno3=0) || (betno4<=0) )
  39. {
  40. printf("entered value is wrong\n");
  41. }
  42.  
  43. if(betno1==s)
  44. {
  45. (cashwon1 = cash1*35);
  46. printf("bet number 1 has won %lf", cashwon1);
  47. gainloss1=((cashwon1-cash1));
  48. printf("profit gain is %d ", gainloss1);
  49. }
  50. else
  51. {
  52. printf("bet number 1 has lost\n");
  53. cashwon1= 0;
  54. }
  55. if(betno2==s)
  56. {
  57. (cashwon2 = cashwon2*35);
  58. printf("bet number 2 has won! %lf", cashwon2);
  59. gainloss2=((cashwon2-cash2));
  60. printf("gain is %lf", gainloss2);
  61. }
  62. else
  63. {
  64. printf("bet number 2 has lost\n");
  65. cashwon2= 0;
  66. }
  67. if(betno3==s)
  68. {
  69. (cashwon3 = cashwon3*35);
  70. printf("bet number 3 has won! %lf", cashwon3);
  71. gainloss3=((cashwon3-cash3));
  72. printf("gain is %lf", gainloss3);
  73. }
  74. else
  75. {
  76. printf("bet number 3 has lost\n");
  77. cashwon3= 0;
  78. }
  79. if(betno4==s)
  80. {
  81. (cashwon4 = cashwon4*35);
  82. printf("bet number 4 has won! %lf", cashwon4);
  83. gainloss4=((cashwon4-cash4));
  84. printf("gain is %lf", gainloss4);
  85. }
  86. else
  87. {
  88. printf("bet number 4 has lost\n");
  89. cashwon4= 0;
  90. }
  91. }