![](/static/253f0d9b/assets/icons/icon-96x96.png)
![](https://lemmy.wtf/api/v3/image_proxy?url=https%3A%2F%2Flemmy.world%2Fpictrs%2Fimage%2F8aead832-799f-4d34-a20d-eae5b621a9b1.jpeg)
What’s absolutely crazy about that is:
Prompt: write code that checks how many r’s are in the word strawberry
Response:
using System;
class Program
{
static void Main()
{
string word = "strawberry";
char targetChar = 'r';
int count = 0;
foreach (char c in word)
{
if (c == targetChar)
count++;
}
Console.WriteLine($"The letter '{targetChar}' appears {count} times in the word \"{word}\".");
}
}
What were they thinking?