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
reverse a number ( like 1234 into 4321) using malloc in C programming
what is mean by oracle?And how it is used?
How do aeroplanes fly? Why can some fly up-side down?
how convert the spiral model to prototype model ?
what the bridge id of any switches
please answer the following question: A table contains the monthly sales data for the 12 months of a year and for the 4 sales zones where each zone has 8 districts.The table is defined in WORKING-STORAGE SECTION.What is the size of the defined table in number of bytes? write statements to calculate the total sales for each month.
i cannot go to my computer to set up why?
Dear frds In my office we are using chiller . in that chiller inlet and outlet water diff. is 2.5 decgree always. if i intduce the cooling tower can i get good result in chiller Inlet water. reply plz.
What is the instruction to load the register B?
Tell me about urself? asked me qstns on my resume what about higher studies any plans? where do u find urself after 3-4
what does static variable mean in c language?
What are the frequently asked technical engineer ques?
C++ PROGRAM FOR FIBONACCI SERIES USING COPY CONSTRUCTER
why B+tree usually prefer as on exis structure to a data file?
how do we calculate physical address if logical address is given in the question?