//
// THIS IS A MACH SIMPLER SOLUTION:
//
void Diamond(int n)
{
for (int i=0;i<=2*n;i++,printf("\n"))
for (int j=0;j<=2*n;j++)
(abs(i-n)+abs(j-n)<=n ? printf("*") : printf(" "));
}
//=============================================
#include<stdio.h>
main()
{
int i,j,k,n,a,b,c,x;
printf("enter the # of rows of graphical output");
scanf("%d",&n);
/* UPPER HALF OF KITE */
for(i=1;i<=n;i++)
{
printf("\t");
for (k=1;k<=(n-i);k++)
{
printf(" ");
}
for(j=0;j<i;j++)
{
printf("*");
printf(" ");
}
for(k=1;k<=(n-i-1);k++)
{
printf(" ");
}
printf("\n");
}
/* LOWER PART OF KITE */
for(i=(n-1);i>0;i--)
{
printf("\t");
for (k=(n-i);k>0;k--)
{
printf(" ");
}
for(j=i;j>0;j--)
{
printf("*");
printf(" ");
}
for(k=(n-i-1);k>0;k--)
{
printf(" ");
}
printf("\n");
}
getch();
}
write a program to print A to Z on screen in c?
(ab)*b
echo 'print a pattern'
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
write a program to print the series 1/12+1/22+.........+1/n2 ?
question clarity
With a text editor, and some basic knowledge of the C programming language.
This is a directive, not a question.
Yes.
good morning
You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.
include <stdio.h> int main (void) { puts ("print"); return 0; }