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

What is a pointer variable in c language?

0 Answers  


let's take a code struct FAQ { int a; char b; float c; double d; int a[10]; }*temp; now explain me how the memory will be allocated for the structure FAQ and what address will be in the structure pointer (temp)....................

8 Answers  


Why is c used in embedded systems?

0 Answers  


Why is %d used in c?

0 Answers  


different between overloading and overriding

3 Answers  






Explain in detail how strset (string handling function works )pls explain it with an example.

1 Answers  


How to receive strings with spaces in scanf()

7 Answers  


Explain what?s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?

1 Answers  


who did come first hen or agg

15 Answers   Infosys,


What is c language used for?

0 Answers  


What is meant by high-order and low-order bytes?

0 Answers  


write function to reverse char array ... without using second array

3 Answers  


Categories