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 meant by operator precedence?

883


diff between exptected result and requirement?

1813


What are enumerated types?

858


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

1733


What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

968


4. main() { int c=- -2; printf("c=%d",c); }

1567


Explain how do you convert strings to numbers in c?

833


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

3402


about c language

1801


Is a pointer a kind of array?

842


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1417


What will the preprocessor do for a program?

788


Difference between strcpy() and memcpy() function?

866


What is a program flowchart and explain how does it help in writing a program?

981


What are the uses of a pointer?

875