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
What is meant by operator precedence?
diff between exptected result and requirement?
What are enumerated types?
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....
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
4. main() { int c=- -2; printf("c=%d",c); }
Explain how do you convert strings to numbers in c?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
about c language
Is a pointer a kind of array?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
What will the preprocessor do for a program?
Difference between strcpy() and memcpy() function?
What is a program flowchart and explain how does it help in writing a program?
What are the uses of a pointer?