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

Answer Posted / tanish kumar

#include <iostream.h>
#include <conio.h>
void main()
{
clrscr ();
int i, j, n;
cout <<"Enter the value of n=";
cin>>n;
for (i=1;i <=n;i++)
{
for (j=1;j <=i;j++)
{
cout <<j <<" ";
}
cout <<endl;
}
getch ();
}

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What will be the outcome of the following conditional statement if the value of variable s is 10?

767


If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.

1791


What are the functions to open and close file in c language?

729


What is the easiest sorting method to use?

635


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

615






What is %lu in c?

687


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

675


What is the size of a union variable?

600


Do you know null pointer?

611


What is NULL pointer?

677


What is a file descriptor in c?

562


Explain the difference between exit() and _exit() function?

634


write a program to print data of 5 five students with structures?

1608


What is the use of gets and puts?

604


How can I read in an object file and jump to locations in it?

579