can someone run these codes for me and put the output here please? thanks!!

#include <iostream>
using namespace std;
void showVar(); // Function prototype
int main()
{ for (int count = 0; count < 10; count++)
showVar();
return 0;
}
// Definition of function showVar
void showVar()
{ static int var = 10;
cout << var << endl;
var++;
}

i dont have anything to run these at home so thanks if anyone can :)

// code 2
#include <iostream>
using namespace std;
void myFunc(); // Function prototype
int main()
{ int var = 100;
cout << var << endl;
myFunc();
cout << var << endl;
return 0;
}
// Definition of function myFunc
void myFunc()
{ int var = 50;
cout << var << endl;
}
IDE one is your friend:
http://www.ideone.com/

Code Snippet 1: http://ideone.com/LOs60W

Code Snippet 2: http://ideone.com/JV4Ifs
thanks!!
Oh... Don't do multiple posts of the same question.
Topic archived. No new replies allowed.