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

what size shaft is required to transmit 100 hp @1000 RPM ,if max shear stress is 10,000 PSI,angle of twist must be less than 1' /ft/shaft is made of steel.

1483


How to recyling of Expired Computer/Laptop,Mouse,CPU & Key Board (Warranty)?

1446


A polynomials in mamory can be represented by____________

1550


why view is created in database

1220


What is CRC? the material will be used in electrical stampings.

1540






what are the various technique used for inter process communication?

1642


what is technical voice process and define it

2520


Explain i.d.e. for visual c++?

1647


what are the artifacts in coding phase in SDLC????

1789


WHAT HAPPEN WHEN ANY SPINDLE RUN OVER 10 MM HEIGHT ABOVE BOLSTAR IN RING SPINNING FRAME

1348


how to convert postfix notation into prefix in data structures. please send me algo of taha

2675


If you were to drill a circular hole in a sheet of metal and then heat the sheet, what would happen to the size of the hole?

673


what is the need for oobs

1706


how to find out the name of the users who are currently working starting with the same characters in unix os

1374


Can u send me a sample Final year CSE student 'RESUME' for campus placement to following mail id: aspnetworks@gmail.com

3219