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.
1
Expert's answer
2011-10-28T09:11:50-0400
#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

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS
paypal