#include <iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;
int main()
{
int N,i;
system("cls");
cout<<"enter the no of rows to be printed";
cin>>N;
for(i=1;i<=N;i++)
{
cout<<"*\n";
}
getch();
}
Kindly note that when you work on an old compiler just replace #include<iostream> to #include<iostream.h> and remove using namespace std.Here I have declared two variables N and i.The variable N is declared and used to ask the user for a positive integer as per your question.And the variable i is used in the execution of for loop till the user's condition satisfies.Please note the an escape sequence \n is very much important because it satisfies your question completely.