Discussions Q&R
Output of C++ code
0 Vote
2 Réponseshelp
-2 Votes
5 RéponsesIn 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 RéponsesLoop
1 Vote
5 RéponsesWhy is not working
0 Vote
3 Réponsesusing System;
namespace GoodProgrammerTest
{
class Program
{
static void Main(string[] args)
{
Console.Write("Enter Yes or No");
Console.Write(
"Do you programme every day? : ") ;
int answer = Console.ReadLine();
if (answer =="Yes")
{
Console.WriteLine(
"You will be a good programmer");
}
else
{
Console.WriteLine(
"You will not be a good programmer");
}
}
}
}
2 Votes
3 RéponsesAujourd'hui en vedette
OOP python questions
1 Votes
What's wrong with my code?
1 Votes
Python loops
1 Votes
Web page
1 Votes
What is a web browser intension?
1 Votes
Percobaan
0 Votes
Mentors
0 Votes