xxxxxxxxxx
#include <iostream>
using namespace std;
int main() {
system("DATE");
return 0;
}
xxxxxxxxxx
- To compile : gcc sourcefile_name.c -o outputfile.exe
- To run : outputfile.exe
Compile and run c++ on windows terminal
xxxxxxxxxx
//compile ex_file.cpp and output ex_file.exe
g++ ex_file.cpp -o ex_file.exe
//run ex_file.exe
.\ex_file.exe
xxxxxxxxxx
#include <iostream>
using namespace std;
int main() {
system("DATE");
return 0;
}
xxxxxxxxxx
#include <iostream>
using namespace std;
int main() {
system("python3 test.py");
return 0;
}
xxxxxxxxxx
#include <iostream>
using namespace std;
int main() {
int age = 18;
if (age >14) {
if (age >=18) {
cout << " Adult";
}
else {
cout << "teeneger";
}
} else {
if (age >0) {
cout <<"child";
}
else {
cout << "something wrong";
}
}
return 0;
}