write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / amit kumar
#include<stdio.h>
#include<conio.h>
main()
{
int i,j,k,s;
for(i=71;i>=65;i--) //first half of sequence
{
for(j=65;j<=i;j++)
{
printf("%c",j);
}
for(s=1;s<((72-j)*2);s++) //for spaces between two trinangles
printf(" ");
for(k=i;k>=65;k--) //for second half of sequence
{
if(k==71)
continue;
printf("%c",k);
}
printf("\n");
}
getch();
return 0;
}
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
What is the significance of scope resolution operator?
What is getche() function?
Why do we use stdio h and conio h?
What is the general form of a C program?
What are the general description for loop statement and available loop types in c?
What is sizeof int in c?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
ATM machine and railway reservation class/object diagram
Write a program to maintain student’s record. Record should
not be available to any unauthorized user. There are three
(3) categories of users. Each user has its own type. It
depends upon user’s type that which kind of operations user
can perform. Their types and options are mentioned below:
1. Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record)
2. Super Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record, Delete Single Record)
3. Guest
(Search Record [by Reg. No or Name], View All Records)
When first time program runs, it asks to create accounts.
Each user type has only 1 account (which means that there
can be maximum 3 accounts). In account creation, following
options are required:
Login Name: <6-10 alphabets long, should be unique>
Password: <6-10 alphabets long, should not display
characters when user type>
Confirm Password:
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
Explain about the functions strcat() and strcmp()?
In a switch statement, explain what will happen if a break statement is omitted?
Why calloc is better than malloc?
what is the function of pragma directive in c?