Q&A Discussões
Output of C++ code
0 Voto
2 Respostashelp
-2 Votos
5 RespostasIn 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 Votos
8 RespostasLoop
1 Voto
5 RespostasC#
0 Voto
1 RespostaWhy is not working
0 Voto
3 Respostasusing 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 Votos
3 RespostasQuente hoje
New code
1 Votes
How would you solve the part of the C# Intermediate code project that requires operator overloading?
0 Votes
Kernel in Jupyter
1 Votes