Input any no. and print all the the numbers that comes
before it like this
for e.g input = 4
0
01
012
0123
01234
plz answer it 2day

Answer Posted / vadivelt

#include<stdio.h>
#include<conio.h>
void main()
{
int no, i, j;
printf("ENTER THE NO:\n");
scanf("%d", &no);
printf("\nOUTPUT IS:\n");
for(i = 0; i<=no; i++)
{
for(j=0; j<=i; j++)
{
printf("%d", j);
}
printf("\n");
}
getch();
}

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program to concatenation the string using switch case?

1564


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1574


Define VARIABLE?

692


What are the different types of control structures in programming?

662


What is keyword in c?

608






diff between exptected result and requirement?

1599


When can you use a pointer with a function?

574


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1501


What is non linear data structure in c?

579


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

606


In a switch statement, explain what will happen if a break statement is omitted?

641


Differentiate between a for loop and a while loop? What are it uses?

677


What does the format %10.2 mean when included in a printf statement?

1094


Explain how can I pad a string to a known length?

661


Can the size of an array be declared at runtime?

614