write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / soumili sen
#include<stdio.h>
int main()
{
int i,j;
for(i=7;i>=1;i--)
{
if(i==7)
{
for(j=1;j<=i;j++)
printf("%c",j+64);
for(j=i-1;j>=1;j--)
printf("%c",j+64);
}
else
{
for(j=1;j<=i;j++)
printf("%c",j+64);
for(j=6;j>=i;j--)
printf(" ");
for(j=5;j>=i;j--)
printf(" ");
for(j=i;j>=1;j--)
printf("%c",j+64);
}
printf("\n");
}
return 0;
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Is null valid for pointers to functions?
if p is a string contained in a string?
How can I automatically locate a programs configuration files in the same directory as the executable?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
Why is it that not all header files are declared in every C program?
What is volatile variable in c?
What is typedef example?
How can I open files mentioned on the command line, and parse option flags?
How are portions of a program disabled in demo versions?
Why functions are used in c?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
Explain the properties of union. What is the size of a union variable
How important is structure in life?