+ 3

What is wrong in this simple program.

x = input("Enter a number to check odd or even") if (x % 2) == 1: print (" x is an odd number) else: print(" x is an even number")

1st Jul 2019, 3:38 PM
Bharat Singla
Bharat Singla - avatar
4 odpowiedzi
+ 16
Here is the right Python code: x = int( input("Enter a number to check odd or even\n") ) if ( x % 2) == 1: print (" x is an odd number") else: print(" x is an even number")
1st Jul 2019, 3:49 PM
VEDANG
VEDANG - avatar
+ 4
You need to close the first print with double quotes (")
1st Jul 2019, 3:48 PM
daniel
daniel - avatar
+ 3
First error: x=int(input(" enter ..") Instead of using directly input function.. Second: string in the 1st print statemwnt is not enclosed within double inverted commas.
1st Jul 2019, 6:00 PM
Suraj Chari
+ 1
What is wrong in this c++ program . #include <iostream> using namespace std; int main() { int x[2][2][3] ={ {{1,2,3}, {4,5,6}} {{7,8,9}, {10,11,12}} }; cout<<x[0][1][2]<<endl; return 0; }
4th Jul 2019, 8:35 AM
ASHISH VASHIST
ASHISH VASHIST - avatar