63 845
Assignments Done
99,2%
Successfully Done
In August 2018

Answer to Question #4843 in C++ for Xav

Question #4843
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.
Expert's answer
#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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions