write a program whose output will be-
1
12
123
1234

Answer Posted / abhishek

#include <iostream>
using namespace std;

int main() {
int i,c=1,p=0;
for(i=0;i<4;i++){
p=p*10+c;
cout<<p<<"
";
c++;
}
return 0;
}

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ponter?

1058


FILE PROGRAMMING

2027


What is a lookup table in c?

858


Explain what is output redirection?

925


Why do we use & in c?

805


Explain what is meant by high-order and low-order bytes?

869


What is string constants?

931


Tell me with an example the self-referential structure?

778


What is the use of f in c?

761


Why is struct padding needed?

852


What is #pragma statements?

877


What are the key features in c programming language?

842


Do you know the use of 'auto' keyword?

899


Write a code to determine the total number of stops an elevator would take to serve N number of people.

1025


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

957