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 |
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
5 Answers TCS, Vimukti Technologies,
What is the most efficient way to count the number of bits which are set in an integer?
main() { int i = -3,j=2,k=0,m; m= ++i || ++j && ++k; printf("%d%d%d",i,j,k,m); }
What is a structure and why it is used?
how to print "hai" in c?
write function to reverse char array ... without using second array
Explain the meaning of keyword 'extern' in a function declaration.
What is a macro, and explain how do you use it?
1.write a program to merge the arrays 2.write efficient code for extracting unique elements from a sorted list of array?
What is a static variable in c?
how many errors in c explain deply
What is structure and union in c?