9 Mar 2013

pattern_nested loops

/*

program in c to print following pattern...

&  &  &  &  &  &  &
   &  &  &  &  &
      &  &  &
         &
*/
 
#include<stdio.h>
#include<conio.h>

void main()
{
int a,t,i,j,k,b=0;
clrscr();
printf("\nEnter length:");
scanf("%d",&a);
b=a;
for(i=0;i<a;i++)
{
 t=i;
 for(j=1;j<=b;j++)
   {
    for(k=1;k<=t;k++)
    {
    printf("   ");
    }
   t=0;
   printf("&  ");
   }
 printf("\n");
 b=b-2;
}



getch();
}

Categories: ,

Related Posts:

  • Inverse_matrix /*   program to find inverse of a matrix...   */ #include<stdio.h> int main() {   int a[3][3],i,j;   float determinant=0;   printf("Enter the 9 elements of matrix: "… Read More
  • Prime_Composite /* program to check entered number is prime or composite....   */ #include<iostream.h> #include<conio.h> void main() { int n,i=2,a=0; clrscr(); cout<<"Enter th number=… Read More
  • pattern_nested loops /* program in c to print following pattern... &  &  &  &  &  &  &    &  &  &  &  &       … Read More
  • perfect_number /*  program to check whether a given no. is a ""perfect no."" or not. a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the sum of its positive divisors e… Read More
  • graplin level-1 solved /* solution to graplin inline challenge level-1 */ #include<stdio.h>#include<conio.h>#include<string.h>void cutstr(char *,int ,int );char arr1[150]={'\0'};char arr2[150]={'\0'};char arr11[]="… Read More

0 comments:

Post a Comment

Copyright © 2025 UPgradeCODING | Powered by Blogger