Answer to Question #216030 in C++ for qwe

Question #216030

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


1
Expert's answer
2021-07-16T03:17:40-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS