Please can someone help me and correct these codes because I don’t know what is wrong. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please can someone help me and correct these codes because I don’t know what is wrong.

#include <iostream> using namespace std; int main() { int arr[4]; cout << “Please enter 4 integers:“ << endl; for(int i = 0; i < 4; i++) cin >> arr[i]; cout << “Values in array are now:“; for(int i = 0; i < 4; i++) cout << “ “ << arr[i]; cout << endl; return 0; }

7th Nov 2019, 12:05 PM
david junior
david junior - avatar
2 Answers
+ 1
david junior run this #include <iostream> using namespace std; int main() { int arr[4]; cout << "Please enter 4 integers: " << endl; for(int i = 0; i < 4; i++){ cin >> arr[i]; } cout << "Values in array are now: "<< endl; for(int i = 0; i < 4; i++){ cout << arr[i]<<endl; } return 0; }
7th Nov 2019, 12:28 PM
Avinesh
Avinesh - avatar
+ 3
david junior Your code contains invalid characters that prevents the compiler from processing the code. You can view these characters if you view the code from a web browser, or in a code editor that supports encoding switches (ANSI/ASCII). Please avoid writing your/others' name in your question tags. Tags are used by search feature to find matches by tag comparison. Thus the presence of irrelevant words in question tags will lessen search engine accuracy. For future reference, please follow this guide to posting a question 👍 https://www.sololearn.com/Discuss/333866/?ref=app
7th Nov 2019, 1:42 PM
Ipang