Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Is null valid for pointers to functions?

1156


if p is a string contained in a string?

1831


How can I automatically locate a programs configuration files in the same directory as the executable?

1147


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

1207


Why is it that not all header files are declared in every C program?

1194


What is volatile variable in c?

1079


What is typedef example?

1168


How can I open files mentioned on the command line, and parse option flags?

1057


How are portions of a program disabled in demo versions?

1280


Why functions are used in c?

1115


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4668


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

2166


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..

2011


Explain the properties of union. What is the size of a union variable

1174


How important is structure in life?

1073