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
Can a pointer be null?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What is s or c?
plz let me know how to become a telecom protocol tester. thank you.
Explain what is the difference between null and nul?
What is a substring in c?
When should volatile modifier be used?
How are strings stored in c?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
Differentiate between Macro and ordinary definition.
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
What is function in c with example?
Can we use any name in place of argv and argc as command line arguments?
Is there any data type in c with variable size?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?