1
01
101
0101
10101
Answers were Sorted based on User's Feedback
Answer / best in the world
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d ",(i+j+1)%2);
}
printf("\n");
}
getch();
}
THIS IS THE BEST SOLUTION IN THE WORLD
Is This Answer Correct ? | 59 Yes | 11 No |
Answer / 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 |
Answer / guriya kumari
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
if(i%2==0)
{
if(j%2==0)
{
k=1;
printf("%d",k);
}
else
{
k=0;
printf("%d",k);
}
}
else
{
if(j%2==0)
{
k=0;
printf("%d",k);
}
else
{
k=1;
printf("%d",k);
}
}
}
printf("\n");
}
}
Is This Answer Correct ? | 7 Yes | 6 No |
Answer / krishna anil dadge
#include<iostream>
using namespace std;
int main()
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
if((i+j)%2==0)
{
cout<<"1";
}
else
{
cout<<"0";
}
}
cout<<endl;
}
return 0;
}
Is This Answer Correct ? | 1 Yes | 0 No |
Derive the equation that links voltage, charge and capacitance.
if we give you the job AS A PETROLEUM ENGINEER WHAT WILL YOU DO(that is extraordinary) for our company
sir ,,kindly provide me 10 year old solved question papers of gate ,i am from CS. branch...
Q.1 Write a C language program to perform CCITT group 3 compression. If possible, scan some images and use your program to compress the images. What kind of compression did you achieve? Q2. How does a magneto-optical technology differ from WORM technology? Explain the differences in the manner in which you would use them for a multimedia system. Q3. What network considerations would you contemplate in designing an enterprise-wide multimedia system which supports fully distributed integrated messaging, sharing of corporate multimedia information databases, and custom business process applications? Q4. Explain the difference between the various types of multimedia object servers. How would you set up hierarchical storage for a large distributed organization? Q5. Explain the role of each type of server required in a multimedia system and the type of storage media that should be used for it. Q6. How do your decisions affect the design? Would different decisions on network technologies and object server technologies result in a different solution?
hi , anyone plz end nic model papers to my id
what is static identifier in c language?
What is Landscape in Sap BW?
What are the features of tata nano , technical specification of tata nano, overview of tata nano, varients of tata nano, price of tata nano, dealers of tata nano, expectation from tata nano, criticism of tata nano, tata nano hybrid ?
explain about scope and storage class in oops
the game of tic-tac-toe is being played between two players. only the last mark to be placed in the game. who will win the game?
Difference between software process model and software process.?
through which part of the woman, wil the food go to foetus?