Thursday, January 22, 2015
c++ Displaying the number repeatedly.
#include "stdafx.h"
#include <iostream>
using namespace std;
int main() {
for(int x= 1;x<=5;x++) {
for(int y=1;y<=5;y++) {
cout<<y;
}
cout<<"\n";
}
cin.get();
cin.get();
return 0;
}
#include "stdafx.h"
#include <iostream>
using namespace std;
int main() {
int a = 1;
cout<<"Enter N:";
cin>>a;
for(int x= 1;x<=a;x++) {
for(int y=1;y<=a;y++) {
cout<<y;
}
cout<<"\n";
}
cin.get();
cin.get();
return 0;
}
Labels:
cplusplus Tutorials
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment