1
01
101
0101
10101

Answer Posted / suket

Mine doesn't require 3 variables:
#include<stdio.h>
int main()
{
int i,j,rows;
printf("Enter no. of rows: ");
scanf("%d",&rows);

printf("Here's your pattern: \n");
for (i=1;i<=rows;i++)
{
for(j=i;j!=0;)
{
if(j%2==0)
{
printf("01");
j=j-2;
}
else
{
printf("1");
j--;
}
}
printf("\n");
}
return 0;
}

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

sir/medam i had completed my B-TECH(CSE)2011 with 61%.i have to go USA for futhure studies.i dnt know what is steps for do futhure studies in USA so could you please tell me

1534


What is frog testing? What is cone model?

1411


Anyone have thesis paper about "Electrical Load Forecasting" . Or the web addresses where people usually upload their thesis paper except IEEE.

1398


What experience have you had in working with field forces?

1526


hai iam selected in po exam in allahabad bank . my interview date is 02-06-2009. so plese send me some sample question on my email. my email is nitinbikhani@yahoo.com

1384






how much the percentile as a good percentile in elitmus.

6277


can any one give 10 ways to create a file in unix...???? through command prompt....

2019


plz tell me which books r important for gate exam (CSE)

1952


How to select the total numbers of fire extinguisher installed in a room ?

1502


how to configure cisco router & switches plz provide me path steps?

1651


am looking for ms,i got ielts score 5.5,and i dont have english score 60 in any any year.tell me can i get offer lettr from any university.is i am elegible..?

1752


How does Earthquake-proofing work?

648


write an algorithm in O(n) time for finding the kth smaalest element form an array of n elements , where n and k are entered by user

1355


compare the conditional operator with if-else-if statement.

1445


what two ways you can use to ensure that visual basic does not allow uncleared variables?

1809