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
Write a java program to print the subsets of a string
CSS corp interview process and placement papers
differance between radix sort and radix exchange sort
what is your experience with computer-aided design software.
How to Define the defect density?
Please send me Sample papers National Informatics Centre (NIC) Programmer. I am giving this paper first time..so if any one have previous question papers send to manoj200.yadav@gmail.com. thnx in advance
How do trains go around bends?
what is total power generation capacity in india at present (as on 12-12-2011)
What a test plan contains
What are the frequently asked technical engineer ques?
verbal quiz and answers
to acheve the IP 65 protection class does it is mandatory to apply silicon grease?
how to connect oracle with java ? Give detail explanation.
difference between w2k and win xp....
hey,,,hi have taken an emergency date of 21st july...i was continuously checking for dates n i was not able to get a normal date n my school is starting from 8th of september...so plz tell me can i get a rejection based on this, that i have taken an emergency date?????