Input
1. An integer
Output
Enter·n:·5
*****
#include <iostream>
using namespace std;
int main(void) {
int n;
cout << "Enter n: ";
cin >> n;
simple(&n);
cout << n;
return 0;
}
#include <iostream>
using namespace std;
void simple(int *n){
while(*n!=0) {
cout<<'*';
(*n)--;
}
}
int main(void) {
int n;
cout << "Enter n: ";
cin >> n;
simple(&n);
cout << '\n';
return 0;
}
Comments
Leave a comment