+ 1
Fruit Bowl C# Problem
https://code.sololearn.com/c4QK6qeDX4IG/?ref=app I made a program but it doesn't work WHY? đ€ What's the problem?
4 Answers
+ 4
You can make very simple i changed little bit .
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
// Takin' input
int fruit;
fruit = Convert.ToInt32(Console.ReadLine());
// Calculation
int apples = (fruit / 6);
Console.WriteLine(apples);
}
}
}
+ 2
Read statement first what question saying If you have 26 pieces of fruit, you have 13 apples, which makes 4 pies, and leaves one apple left over.
Total 26 pieces if you divide by 2 then u will get half half 13-13 and 3 apple make 1 pice and if you divide 13/3 then you will get 4 pices over 13 and left 1 that the statement you can do simple for better understanding
(fruit/2)/3
+ 1
Why you are dividing it to 6
0
Thnx Jasprit I understood and solved just now
After 9 hours đ and yes I'm slow learner