Write a program to produce the following output:
1
2 3
4 5 6
7 8 9 10
Answer / ashok kumar
void main()
{
int n,i,j,k=1;
clrscr();
printf("\n Enter a number : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=i;j<n;j++)
printf(" ");
for(j=1;j<=i;j++)
printf(" %d ",k++);
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 31 Yes | 19 No |
What is the difference between test design and test case design?
how we can make 3d venturing graphics on outer interface
What is the purpose of 'register' keyword in c language?
simple program for virtual function?
How can I do serial ("comm") port I/O?
What is the purpose of the statement: strcat (S2, S1)?
How to use c/c++ code in JAVA
10 Answers CDAC, IBM, Satyam, Scope International,
Why array is used in c?
which types of data structure will i use to convert infix to post fix???
Does c have class?
how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48
using only #include <stdio.h> and #include <stdlib.h> Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.