Please why am I getting an error | Sololearn: Learn to code for FREE!

0

Please why am I getting an error

Looping through an Array in C..I am getting an error https://code.sololearn.com/c5FX6Cc7uczd/?ref=app

7/6/2022 8:20:10 AM

steve Purpose

13 Answers

New Answer

+2

Steve, Code is logically fine. The problem here is the code contains invalid characters that are unacceptable by the compiler. Those invalid characters got accidentally copied, usually from web pages. If you have an encoding option in your code editor then try to set it to ANSI or ISO-8859-15 encoding. There you will see them.

+2

Steve, This may not seem all too different to your original code, but the invalid characters had been removed #include <stdio.h> int main() { int myNumbers[] = { 25, 50, 75, 100 }; int i; for(i = 0; i < 4; i++) { printf("%d\n", myNumbers[i]); } } Here's how it looks in my phone, edited in QuickEdit https://www.sololearn.com/post/1702671/?ref=app

+1

Ipang probably there's an error on the web page..Thanks I'll edit it by typing out manually now

0

paste the code and answer here. I can't access that link

0

#include <stdio.h> int main() { int myNumbers[] = {25, 50, 75, 100}; int i; for (i = 0; i < 4; i++) {   printf("%d\n", myNumbers[i]); } }

0

The code seems okay. What error are you getting? what was the question again?

0

Run in to see what you get

0

I got none of those..can you paste the ANSI and let me c..I used replit code editor and sololearn playground

0

Steve, Can you open this code in browser (SoloLearn web interface)? there it also shows the invalid characters ...

0

Can you please paste it here

0

Ipang for some reason I can't access the web interface code playground

0

Steve, You mean you can't access my feed post link? feed post links are only accessible via SoloLearn mobile app ...

0

Ok corrected ✌️