-3
I found that I can use two programming languages in the same program, but I don’t know exactly how to do this... I just wanted an idea in a very simple example to make the code work below and I learn.
I have a python program that has an input of the whole type (int), the user type any value in it below 300:
num = int(input("Digite o número: "))
After this I wanted to somehow pass the value of num
for a C++ code that only executes a loop for
with the value given in num
:
//nota-se que o valor de 'a' seria o valor atribuído na variável 'num' no arquivo .py
for(a=num; a<300; a++){
cout << a << endl;
}
I had first thought to put for example a #include
, but I don’t know if doing such a thing would result in some mistake.