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

Answer Posted / chaitanya

#include<stdio.h>
void main()
{
int s,i,j,n=1;
printf("enter the length of the sequence
");
scanf("%d",&s);
for(i=1;i<=s;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf(" ");
}
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is scope rule of function in c?

552


When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?

809


How many data structures are there in c?

617


How can you tell whether two strings are the same?

834


Should I learn data structures in c or python?

583






Can we declare function inside main?

569


Why c is procedure oriented?

574


Explain the difference between null pointer and void pointer.

671


Write a progarm to find the length of string using switch case?

1612


What is main () in c?

588


What is main () in c language?

597


What is the purpose of ftell?

601


write a c program to calculate sum of digits till it reduces to a single digit using recursion

2719


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

746


in iso what are the common technological language?

1637