I need help on my array code in C | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I need help on my array code in C

Please help me on this exercise, I dont know why am I getting no score using my code. Instructions: An array containing 40 integer elements is already provided for you in the code editor below. Using loops and conditions, print out the cube of the array element if it is a positive number, and print out the square of the number if it is negative. Each result must be printed out separately by each line. Output The squares and cubes of the elements in the array. 4 1 1 8 27 . . . https://code.sololearn.com/cXc9Mq3KehQ7/?ref=app

23rd Feb 2022, 4:44 AM
Tairitsu
Tairitsu - avatar
3 Answers
+ 5
It might be as simple as the leading blank space that you print. Have you tried removing that?
23rd Feb 2022, 5:14 AM
Ani Jona 🕊
Ani Jona 🕊 - avatar
+ 1
Great :)
23rd Feb 2022, 10:07 AM
Ani Jona 🕊
Ani Jona 🕊 - avatar
0
thank you @Ani it worked!!!!!!
23rd Feb 2022, 8:23 AM
Tairitsu
Tairitsu - avatar