1
01
101
0101
10101

Answers were Sorted based on User's Feedback



1 01 101 0101 10101..

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

1 01 101 0101 10101..

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

1 01 101 0101 10101..

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

1 01 101 0101 10101..

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

Post New Answer

More Engineering AllOther Interview Questions

Derive the equation that links voltage, charge and capacitance.

0 Answers  


if we give you the job AS A PETROLEUM ENGINEER WHAT WILL YOU DO(that is extraordinary) for our company

0 Answers   ONGC,


sir ,,kindly provide me 10 year old solved question papers of gate ,i am from CS. branch...

0 Answers  


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?

0 Answers  


hi , anyone plz end nic model papers to my id

0 Answers   NIC,






what is static identifier in c language?

0 Answers  


What is Landscape in Sap BW?

0 Answers  


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 ?

0 Answers   TATA,


explain about scope and storage class in oops

0 Answers  


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?

8 Answers   Infosys,


Difference between software process model and software process.?

0 Answers  


through which part of the woman, wil the food go to foetus?

1 Answers   IOCL,


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)