write a function with no argument that displays a message telling howmany times it has been called. write a main program that calls this function atleast 10 times .don't use external variable. write a c++ program
#include<iostream>
using namespace std;
int my_Function(void) {
static unsigned int call_time = 0;
call_time++;
cout<<"Called first time "<<call_time<<endl;
}
int main(){
my_Function();
my_Function();
my_Function();
return 0;
}
Comments
Leave a comment