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 |
What are valid signatures for the Main function?
write a c program to check weather a particluar bit is set or not?
What are actual arguments?
main() {int a=200*200/100; printf("%d",a); }
Explain which function in c can be used to append a string to another string?
what is the structure pointer?
dynamically allocate memory for linear array of n integers,store some elements in it and find some of them
what are the uses of structure?
what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CHOUDHARY" }; printf("\nstring1=%s",str[0]); printf("\nstring2=%s",str[1]); printf("\nstring3=%s",str[2]); a)string1=Manish string2=Kumar string3=Choudhary b)string1=Manish string2=Manish string3=Manish c)string1=Manish Kumar Choudhary string2=(null) string3=(null) d)Compiler error
f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c?
What is the difference between new and malloc functions?
what is difference between null and nul in c language