Hi everyone!
i wrote code for printing a double triangle. Its woking fine upto input is 7. but when the input is 8 the output is disturbed. can any one suggest me a solution? the code is this.
#include<iostream>
using namespace std;
int main()
{
int a;
cout<<"Enter a number"<<endl;
cin>>a;
int stars=1;
int stars1=1;
for(int i=0 ; i<a ; i++)
{
for(int j=0 ; j<stars1 ; j++)
cout<<"*";
stars1++;