Create a function called Count() that keeps track of how many times it has been called. Each time it is called, it should display a line similar to:
This is call Number 5
Demonstrate that it works by setting up a loop in main() that will call it five times. Do not use reference variables. Do not keep track in main(). Count() must keep track. Hint: this is a *really* easy problem.
#include <iostream.h>
#include <conio.h>
int i,c=0;
int count(){
& c++;
& cout<<"This is call Number "<<c<<"\r\n";
& }
main(){
for (i=1;i<=5;i++) count();
getch();
}
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!
Learn more about our help with Assignments:
C++