Sunday, December 2, 2012

Stair case of numbers using FOR loop in C++


#include<iostream.h>
#include<conio.h>
int main()
{
int i,j,c;
clrscr();
cout<<"Enter the lines"<<"\n";
cin>>c;
for(i=0;i<c;i++)
{
for(j=0;j<=i;j++)
{
cout<<i;
}
cout<<"\n";
}
return 0;
}

No comments:

Post a Comment

DC motor control with Pulse Width Modulation Part 1

DC Motor intro DC motor is a device which converts electrical energy into kinetic energy. It converts the DC power into movement. The typica...