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 the -> in c?
What is function in c with example?
What is the difference between array and pointer in c?
How can you find out how much memory is available?
What is data structure in c language?
What is a 'null pointer assignment' error?
What is file in c language?
What are the salient features of c languages?
What is the code in while loop that returns the output of given code?
Is main an identifier in c?
What is n in c?
In c language can we compile a program without main() function?
Differentiate between a structure and a union.
how to capitalise first letter of each word in a given string?
Explain the difference between the local variable and global variable in c?