define and use of global variable.


SUBMITTED BY: Nrupeshsinh

DATE: June 22, 2016, 11:54 a.m.

FORMAT: Text only

SIZE: 320 Bytes

HITS: 597

  1. # include<iostream.h>
  2. # include<conio.h>
  3. int count=0;
  4. void test1()
  5. {
  6. cout<<"Test1 Count= "<<++count<<endl;
  7. }
  8. void test2()
  9. {
  10. static int count;
  11. cout<<"Test2 count="<<++count<<endl;
  12. }
  13. void main()
  14. {
  15. clrscr();
  16. int count=0;
  17. for(count=0;count<5;count++)
  18. {
  19. test1();
  20. test2();
  21. }
  22. getch();
  23. }

comments powered by Disqus