Q&A Discussies
WY I get a rundum number from memory when I run this code
#include <iostream>
using namespace std;
int main ()
{
int array [5];
for (int x = 0; x < 5; x++) {
array [x] = 42;
cout << x << ': ' << array [x] << endl;
}
return 0;
}
if I replace ': ' with ": " every thing works well.
0 Stemmen
2 AntwoordenCout__x
0 Stemmen
2 Antwoordenwhat is tjis code problem!
#include <iostream>
using namespace std;
int main()
{
int b = 5;
int arr[b] = {11, 35, 62, 555, 989};
int sum = 0;
for (int x = 0; x < 5; x++) {
sum += arr[x];
}
cout << sum << endl;
return 0;
}
I cannot make an array using int variable in order to define array's element number!?
1 Stem
7 AntwoordenPlz answer?
1 Stem
2 AntwoordenPopulair vandaag
Debugging issue?
0 Votes
Text editor
0 Votes
how to view only application
0 Votes
I’m really confused
0 Votes
Subscription
0 Votes
Stream
0 Votes
What is Typecasting?
1 Votes
Scraping
0 Votes
Make a app
0 Votes