You are viewing a single comment's thread. Return to all comments →
This code can't run in hackerrank but it run in codeblock and online compiler with same output.plz someone solve this if i am wrong.
#include <iostream>
using namespace std;
int main() { int n; cout << "Enter any n: "; cin >> n;
if (n == 1) { cout << "one" << endl; } else if (n == 2) { cout << "two" << endl; } else if (n == 3) { cout << "three" << endl; } else if (n == 4) { cout << "four" << endl; } else if (n == 5) { cout << "five" << endl; } else if (n == 6) { cout << "six" << endl; } else if (n == 7) { cout << "seven" << endl; } else if (n == 8) { cout << "eight" << endl; } else if (n == 9) { cout << "nine" << endl; } else { cout << "Greater than nine" << endl; } return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Conditional Statements
You are viewing a single comment's thread. Return to all comments →
This code can't run in hackerrank but it run in codeblock and online compiler with same output.plz someone solve this if i am wrong.
using namespace std;
int main() { int n; cout << "Enter any n: "; cin >> n;
}