Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

a simple c program using 'for' loop to display the output 5 4 3 2 1

2 Answers   Google,


In which language linux is written?

0 Answers  


marge linklist

0 Answers   HCL,


Why data types in all programming languages have some range? Why ritche have disigned first time likethat?Why not a single data type can support all other types?

2 Answers   Excel,


what do you mean by defining a variable in our c code?

2 Answers  


how can we print  hellow world programme without using semicolon

3 Answers  


void main() {int i=2; printf("%d%d%d",i,++i,i++); getch(); }

9 Answers  


why r u join this company? give solid resons.

16 Answers   IBM, Infosys, TCS,


What is an identifier?

0 Answers  


How do you construct an increment statement or decrement statement in C?

0 Answers  


Tell me can the size of an array be declared at runtime?

0 Answers  


without a terminator how can we print a message in a printf () function.

7 Answers   NIIT,


Categories