Showing posts with label asterik. Show all posts
Coding program to print right triangle through odd number in C through asteriks.
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
for(int d=1;d<=5;d++){
do {
printf("enter a odd no");
scanf("%d",&a);
}
while(a%2!=1);
int b;
for(b=0;b<a;b++)
{
for(int c=0;c<=b;c++)
printf("*");
printf("\n");
}}
_getch();
}
#include<conio.h>
void main()
{
int a;
for(int d=1;d<=5;d++){
do {
printf("enter a odd no");
scanf("%d",&a);
}
while(a%2!=1);
int b;
for(b=0;b<a;b++)
{
for(int c=0;c<=b;c++)
printf("*");
printf("\n");
}}
_getch();
}
Monday, 22 December 2014
Posted by Unknown