#include <iostream> #include <iomanip> #include <string> int main() { int i, j, k; float x, y, z; i = 10; j = 12; k = i * j; x = 1.25; y = 0.5; z = x * y; if (i % 2 == 0) cout << "genap"; else cout << "ganjil"; float result = i * j*j; cout << "hasilnya: " << result <<" k = "<<k<<; }
Standard input is empty
prog.cpp: In function ‘int main()’:
prog.cpp:16:3: error: ‘cout’ was not declared in this scope
cout << "genap";
^~~~
prog.cpp:16:3: note: suggested alternative:
In file included from prog.cpp:1:
/usr/include/c++/8/iostream:61:18: note: ‘std::cout’
extern ostream cout; /// Linked to standard output
^~~~
prog.cpp:18:3: error: ‘cout’ was not declared in this scope
cout << "ganjil";
^~~~
prog.cpp:18:3: note: suggested alternative:
In file included from prog.cpp:1:
/usr/include/c++/8/iostream:61:18: note: ‘std::cout’
extern ostream cout; /// Linked to standard output
^~~~
prog.cpp:20:1: error: ‘cout’ was not declared in this scope
cout << "hasilnya: " << result <<" k = "<<k<<;
^~~~
prog.cpp:20:1: note: suggested alternative:
In file included from prog.cpp:1:
/usr/include/c++/8/iostream:61:18: note: ‘std::cout’
extern ostream cout; /// Linked to standard output
^~~~
prog.cpp:20:48: error: expected primary-expression before ‘;’ token
cout << "hasilnya: " << result <<" k = "<<k<<;
^
Standard output is empty