How do I convert this basic phyton code to basic C++

Hello, I am taking an intro to c++ class and they gave us a bunch of code in Python to convert to C++. Can anyone help me figure it out? Thanks in advance!

Here is the Python code that needs to be converted to c++

if True:
print "True"
else:
print "False"

and the other question is


if True:
print "Answer"
print "True"
else:
print "Answer"
print "False"
You can replace the print statement with std::cout << "Whatever" << std::endl;, remembering to #include <iostream>. I think you can figure out the rest.
Last edited on
1
2
3
4
#include "stdio.h"
int main(){
	printf("True\n");
}
Last edited on
Topic archived. No new replies allowed.