fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. class Ex1{
  6. public:
  7. static void meth1(){
  8. cout << "Welcome to meth1 \n";
  9. }
  10. static void meth2(){
  11. for(int k=0; k<=5; k++){
  12. cout << "k = " << k << endl;
  13. }
  14. }
  15. };
  16. int main() {
  17. // your code goes here
  18. cout << "Calling ex1 method \n";
  19. Ex1::meth1();
  20. Ex1::meth2();
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Calling ex1 method 
Welcome to meth1 
k = 0
k = 1
k = 2
k = 3
k = 4
k = 5