Q&A Discussions
In the code below the output is 2. This code is used in a challenge and I get an error when I select the answer 2. It accepts as correct the answer 1 which I believe is wrong. If you agree please thumbs up.
If you find any other errors please post them here!
#include <iostream>
using namespace std;
int main()
{
for(int i=1; i>=1; i++) {
if(i<1 || i>1){
cout << i;
break;
}
}
return 0;
}
8 Votes
8 AnswersGuys please help me with these (assignment) :
-create a function "manipulate_data" that does the following;
1.accepts as the first parameter astring specifying the data structure to be used e. g a list.
2.accepts as the second parameter the data to be manipulated based on the data structure specified e.g [1,4,9,16,25] for alist data structure.
0 Votes
7 AnswersWhile prototyping friend functions in a class is it necessary to always pass the address of the object as parameter?If so why is it that we have to pass address as parameter..In programs involving compositions we never used addresses...Why is the need for address of the objects while using friend?
4 Votes
1 Answer
so although using srand(time(0)) can be used to get truly random numbers, how truly random are they? For example, if one were to call this method at the same time (in this example, if one were to use this command at 51s) each time would the numbers generated be the same???
If so, are the numbers still truly random??
And if this theory is true, how can one generate truly random numbers that cannot repeat based on external variables (e.g., time)?
2 Votes
4 AnswersHot today
Sticky position
2 Votes
Help please?
3 Votes
Online voting system
2 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
SQL practice
2 Votes
Game development
0 Votes
Ruby programming?
3 Votes