Program to print 0 to 9 in cross order

Answers were Sorted based on User's Feedback



Program to print 0 to 9 in cross order..

Answer / james

#include<iostream.h>

int main()
{
for(int i=0;i<=9;i++)
{
for (int j = 0; j <=i; j++)
cout << " ";
cout << i << endl;
}
}

Is This Answer Correct ?    3 Yes 0 No

Program to print 0 to 9 in cross order..

Answer / aakash dang

#include<iostream.h>
#include<conio.h>

void main()
{
int x,y;
x=1,y=1;

for(int i=0;i<=9;i++)
{
cout<<i;
gotoxy(x,y);
x++;
y++;
}
getch();
}

Is This Answer Correct ?    2 Yes 1 No

Program to print 0 to 9 in cross order..

Answer / kalyan chukka

#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,j;
clrscr();
for(i=0;i<=9;i++)
{
for(j=1;j<=i;j++)
{
printf(" ");
}
printf("%d\n ",i);
}
getch();
}


Check in windows Environment

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More OOPS Interview Questions

Why do we need oop?

0 Answers  


Explain the concepts involved in Object Oriented programming.

0 Answers   Wipro,


Write a program to reverse a string using recursive function?

0 Answers   TCS,


What is constructor in oop?

0 Answers  


explain defference between structure and class with example

1 Answers  






What are the important components of cohesion?

0 Answers  


what type of question are asked in thoughtworks pair programming round ?

0 Answers   Thought Works,


What is persistence in oop?

0 Answers  


why the memory allocated with new cant be freed using free()

2 Answers  


what is the use of mutable key word

3 Answers   HCL,


what is virtual destructor

7 Answers   L&T, TCS,


where is memory for struct allocated? where is memory for class-object allocated? I replied for struct in stack and for class-object in heap. THen he asked if class has struct member variable what happens.class on heap and what about struct in that class? couldnt ans :( :-?

2 Answers   Infosys, Microsoft,


Categories