Write a program in c to print
1
121
12321
1234321
123454321
Answers were Sorted based on User's Feedback
Answer / vivek raghuwanshi
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,num;
cout<<num;
for(i=1;i<=num;i++)
{
for(j=1;j<i-1;j++)
{
cout<<" ";
}
for(k=1;k<i;k++)
{
cout<<k;
}
for(k=i;k>=1;k--)
{
cout<<k;
}
}
}
Is This Answer Correct ? | 13 Yes | 31 No |
Explain what is the benefit of using an enum rather than a #define constant?
Write a program to find the number of times that a given word(i.e. a short string) occurs in a sentence (i.e. a long string!). Read data from standard input. The first line is a single word, which is followed by general text on the second line. Read both up to a newline character, and insert a terminating null before processing. Typical output should be: The word is "the". The sentence is "the cat sat on the mat". The word occurs 2 times.
write a C program, given number is double without using addt ion and multiplication operator?ex:n=6,ans=12,pls send me ans to goviseenu@gmail.com
Explain what is the difference between #include and #include 'file' ?
Explain how do you search data in a data file using random access method?
Explain what’s a signal? Explain what do I use signals for?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
difference between loading and linking
What is dynamic variable in c?
n=7623 { temp=n/10; result=temp*10+ result; n=n/10 }
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
What is advantage of pointer in c?