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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between calloc and malloc.

762


In c language can we compile a program without main() function?

584


The statement, int(*x[]) () what does in indicate?

649


What do you mean by c?

592


What does c mean in basketball?

563






What is the difference between declaring a variable and defining a variable?

726


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

1718


Can you subtract pointers from each other? Why would you?

561


What is a newline escape sequence?

668


Are pointers really faster than arrays?

569


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

1635


How to implement a packet in C

2401


Why do we need a structure?

594


Which is best linux os?

568


Differentiate between ordinary variable and pointer in c.

623