Q&A Discussions
Output of C++ code
0 Votes
2 AnswersIn 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 AnswersWhat's Wrong With My Code??
0 Votes
2 Answersما هو الخطأ فى هذا الكود
0 Votes
2 AnswersWhy is not working
0 Votes
3 Answersusing 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 AnswersHot today
Data Analysis Course
1 Votes
Time up code for data revision
0 Votes
Web vs python
0 Votes
Is there LUA?
0 Votes
I want to learn why this error occurs in "while loop" function of Pythone.Can someone explain to me?
1 Votes
Best Python Calculator Code
1 Votes