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 the -> in c?

585


What is function in c with example?

629


What is the difference between array and pointer in c?

579


How can you find out how much memory is available?

618


What is data structure in c language?

606






What is a 'null pointer assignment' error?

726


What is file in c language?

576


What are the salient features of c languages?

625


What is the code in while loop that returns the output of given code?

1316


Is main an identifier in c?

601


What is n in c?

575


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

580


Differentiate between a structure and a union.

768


how to capitalise first letter of each word in a given string?

1434


Explain the difference between the local variable and global variable in c?

602