abcdedcba
abc cba
ab ba
a a

Answers were Sorted based on User's Feedback



abcdedcba abc cba ab ba a a..

Answer / sachinb

Give me answer

Is This Answer Correct ?    2 Yes 1 No

abcdedcba abc cba ab ba a a..

Answer / p.pratyusha

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i=5,q,n=-1,r;
for(q=0;q<i;q++)
{
char ch='A';
for(int j=0;j<i;j++)
{
cout<<ch;
++ch;
}
if(n>0)
{
for(int k=n;k>0;k--)
{
cout<<" ";
}
}
for(r=0;r<i-1;r--)
{
ch--;
cout<<ch;

}
cout<<endl;
n+=2;
--i;
}
}

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Code Interview Questions

main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above

2 Answers   HCL, LG,


Write a program to receive an integer and find its octal equivalent?

7 Answers  


main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }

1 Answers  


main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above

3 Answers   HCL,


void main() { int i=i++,j=j++,k=k++; printf(ā€œ%d%d%dā€,i,j,k); }

1 Answers  






main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above

1 Answers   HCL,


main() { char *p="GOOD"; char a[ ]="GOOD"; printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p)); printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); }

1 Answers  


Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.

5 Answers   Amazon, Microsoft,


Write a complete program that consists of a function that can receive two numbers from a user (M and N) as a parameter. Then print all the numbers between the two numbers including the number itself. If the value of M is smaller than N, print the numbers in ascending flow. If the value of M is bigger than N, print the numbers in descending flow. may i know how the coding look like?

2 Answers  


main() { int i=10; i=!i>14; Printf ("i=%d",i); }

1 Answers  


What is the hidden bug with the following statement? assert(val++ != 0);

1 Answers  


Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number

2 Answers   Ace Info,


Categories