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 |
hello friends what do u mean by BUS ERROR i got this error while i am doing my program in DATA STRUCTURES
write a “Hello World” program in “c” without using a semicolon?
How can we allocate array or structure bigger than 64kb?
How do you write a program which produces its own source code as output?
Why c++ is called c++ and not c+?
what will the following program do? void main() { int i; char a[]="String"; char *p="New Sring"; char *Temp; Temp=a; a=malloc(strlen(p) + 1); strcpy(a,p); //Line no:9// p = malloc(strlen(Temp) + 1); strcpy(p,Temp); printf("(%s, %s)",a,p); free(p); free(a); } //Line no 15// a) Swap contents of p & a and print:(New string, string) b) Generate compilation error in line number 8 c) Generate compilation error in line number 5 d) Generate compilation error in line number 7 e) Generate compilation error in line number 1
What is the output for the below program? void main() { float me=1.1; double you=1.1; if(me==you) printf("love c"); else printf("know c"); }
pgm in c to reverse string by word using array(god is love becomes love is god) (no additional array can used,space is only delimiter between words )
What are the differences between new and malloc in C?
What is New modifiers?
Explain what is the difference between null and nul?
write a program to fined second smallest and largest element in a given series of elements (without sorting)