Input any no. and print all the the numbers that comes
before it like this
for e.g input = 4
0
01
012
0123
01234
plz answer it 2day

Answers were Sorted based on User's Feedback



Input any no. and print all the the numbers that comes before it like this for e.g input = 4 0 0..

Answer / vadivelt

#include<stdio.h>
#include<conio.h>
void main()
{
int no, i, j;
printf("ENTER THE NO:\n");
scanf("%d", &no);
printf("\nOUTPUT IS:\n");
for(i = 0; i<=no; i++)
{
for(j=0; j<=i; j++)
{
printf("%d", j);
}
printf("\n");
}
getch();
}

Is This Answer Correct ?    9 Yes 1 No

Input any no. and print all the the numbers that comes before it like this for e.g input = 4 0 0..

Answer / anurag

#include<iostream>
using namespace std;

int main()
{
int a=4;
for(int i=0;i<=4;i++)
{
int j=0;
while(j<=i)
{
cout<<j;
j+=1;
}
cout<<endl;
}
}

Is This Answer Correct ?    2 Yes 0 No

Input any no. and print all the the numbers that comes before it like this for e.g input = 4 0 0..

Answer / abc

void main()
{
int n,i,j;
printf("enter the number");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
for(j=0;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More C Interview Questions

i want to job in your company, so how it will be possible.

3 Answers   TCS,


Calculate 1*2*3*____*n using recursive function??

0 Answers  


Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer

0 Answers   TCS,


hello friends what do u mean by BUS ERROR i got this error while i am doing my program in DATA STRUCTURES

2 Answers   Wipro,


What do you mean by keywords in c?

0 Answers  






What are qualifiers?

0 Answers  


HOW CAN ADD OUR FUNCTION IN LIBRARY.

5 Answers  


Define the scope of static variables.

0 Answers  


Write a c program to read a positive number and display it in words.? ex: 123=one two three help me....

2 Answers  


study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)++; printf("a=%dn(*p)=%dn",a,*p); } What is printed? A)100,101 B)100,100 C)101,101 D)None of the above

15 Answers   Accenture, TCS,


What is the Difference between Class and Struct?

10 Answers   Motorola,


what is difference between procedural language and functional language ?

4 Answers   Wipro,


Categories