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

What is for loop and its syntax?

0 Answers  


given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy

0 Answers   DELL,


Difference between vector and array

2 Answers  


What is interface? When and where is it used?

0 Answers  


How do you define social class?

0 Answers  






If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?

0 Answers  


What is difference between #define and const?

3 Answers   emc2,


write a programe to calculate the simple intrest and compund intrest using by function overlading

0 Answers  


What is use of overloading?

0 Answers  


what is ns string? what is ns array?

1 Answers  


Can java compiler skips any statement during compilation time?

0 Answers  


Why do while loop is used?

0 Answers  


Categories