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 are oops functions?

0 Answers  


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

0 Answers   IBM,


Do you know about multiple inheritance?

1 Answers   Motorola,


what is the 3 types of system development life cycle

1 Answers  


what is code for call by value and call by reference?

1 Answers  






WAP find square root of any number (without using sqrt() )?

3 Answers  


who is the father of OPPS

4 Answers   Infosys, TCS,


Differences between inline functions and non-inline functions?

4 Answers   Ness Technologies,


all about pointers

2 Answers  


what is difference between objects and function

3 Answers  


WHAT IS ABSTRUCT DATA TYPE ? PLEASE EXPLAIN IT.

4 Answers   HCL,


write a program in c++ to overload the function add (s1,s2) where s1 and s2 are integers and floating point values.

4 Answers  


Categories