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
What would be the difficulties with building a bridge that connects the UK and Canada?
I have failed my intermediate can i write entrance exam the next year after completing my backlogs
I am going to appear for ISRO written test on 26 th april 2009 .So kindly forward me sample previous question paper for ISRO for BE Computer Science . My mail id : jothychristiya@gmail.com
2. A product selected for testing is equally likely to have been produced by one the 6 machines/processes. (i) Determine sample space āSā (ii) What is the probability that the product is from machine 1? (iii) What is the probability that the product is from machine 2 or machine 4? (iv) What is the probability that the product is from both machine 5 and machine 3? (v) What is the probability that the product is not from machine 6? (vi) What is the probability that the product is not from either machine 6 or machine 1?
how to print a number in character(ex. 123= one twenty three)?
Define configuration and calibration and explain with an example
Please send the details and fee for Intools training course..I would like to do the course in second week of jUNE 2010.
how does data cleansing framework works?
int i=~0; uint j=(uint)i; j++; printf(ā%dā,j); what is the use of "uint" int the above code
need tcs questn papers from 2007 to 2009 plzzzmail to 9015.rama@gmail.com its urgent
why B+tree usually prefer as on exis structure to a data file?
What are daemon Threads?
what is the definition(body) of a default constructor in c++?
what is the difference between oracle 8i and 9i. if someone could help me out.
who is your role modal give in few sentances