For Loop In C++


SUBMITTED BY: Nrupeshsinh

DATE: June 24, 2016, 8:20 a.m.

FORMAT: Text only

SIZE: 413 Bytes

HITS: 431

  1. #include<iostream>
  2. #include<conio.h>
  3. using namespace std;
  4. int main()
  5. {
  6. // Variable Declaration
  7. int a;
  8. // Get Input Value
  9. cout<<"Enter the Number :";
  10. cin>>a;
  11. //for Loop Block
  12. for (int counter = 1; counter <= a; counter++)
  13. {
  14. cout<<"Execute "<<counter<<" time"<<endl;
  15. }
  16. // Wait For Output Screen
  17. getch();
  18. return 0;
  19. }

comments powered by Disqus