Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
Write a program that display
+23
votes
asked
Jan 22, 2022
by
Zohaib
(
420
points)
closed
Feb 6, 2022
by
Admin
Write a program that display
0000
111
22
3
closed with the note:
answered
help-please
c
2 Answers
+6
votes
answered
Jan 22, 2022
by
Zohaib
(
420
points)
Best answer
#include <stdio.h>
int main()
{ int i=0,j=3;
for(i=0;i<=3;i++)
{
for(j=3;j>=i;j--)
{
printf("%d",i);
}
printf("\n");
}
}
commented
Jan 23, 2022
by
Peter Minarik
(
86,860
points)
I think the "Best answer" deserves to be correct: there's a
return 0;
missing from the end of the main().
:)
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
+3
votes
answered
Feb 2, 2022
by
Yash Khadikar
(
200
points)
#include <stdio.h>
int main()
{
int num=0;
for(int i=4;i>0;i--)
{
for(int j=0;j<i;j++)
{
printf("%d",num);
}
printf("\n");
num++;
}
return 0;
}
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...