Friday, August 31, 2012

Floyd's Triangle using C language

#include<stdio.h>
main()
{
int r,p,a=1,i,j;
printf("\n Enter number of rows");
scanf("%d",&r);
for(i=0;i<r;i++)
{
for(j=0;j<i+1;j++)
{
printf("%d \t",a);
a++;
}
printf("\n");
}
getch();
}

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...