create a C program that displays one z,two y's,three x's
until twenty six A's.
plzz answer i need it tomorrow.

Answers were Sorted based on User's Feedback



create a C program that displays one z,two y's,three x's until twenty six A's. plzz..

Answer / sujata

int Totchar_count =26;
int cur_postion= 26 ;
int diff=0;
char cur_char ='Z';
do
{
diff = (Totchar_count+1) -cur_postion;
while(diff >=1)
{
printf("%c",&c);
diff--;
}
cur_position--;
cur_char--;
}while(c !='Z'-Totchar_count);

Is This Answer Correct ?    1 Yes 1 No

create a C program that displays one z,two y's,three x's until twenty six A's. plzz..

Answer / d14bbl0

#include<stdio.h>

int main(){
int i,count;

for (i=0;i<26;i++){
for (count = 0;count<i;count++){
printf("%c",(char)('Z'-i));
}
}
return 0;
}

Is This Answer Correct ?    0 Yes 0 No

create a C program that displays one z,two y's,three x's until twenty six A's. plzz..

Answer / vadivelt

Qn seems to be not very clear.. Could u pls post it clearly
so that, can answer.

Is This Answer Correct ?    0 Yes 1 No

create a C program that displays one z,two y's,three x's until twenty six A's. plzz..

Answer / satya

#include<conio.h>
main()
{ int i,j;
char *ptr="z";
clrscr();
for(i=1;i<=26;i++)
{
for(j=1;j<=i;j++)
{
printf("%s",ptr);
}
--(*ptr);
printf("\n");
}
getch();



}

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

Define the scope of static variables.

0 Answers  


#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }

1 Answers  


What is array of structure in c?

0 Answers  


long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes

18 Answers   Acropolis, HCL, Intel, TCS,


main() { FILE *fs; char c[10]; fs = fopen(“source.txt”, ”r”); /* source.txt exists and contains “Vector Institute” */ fseek(fs,0,SEEK_END); fseek(fs,-3L,SEEK_CUR); fgets(c,5,fs); puts(c); }

1 Answers   Vector,






What is string concatenation in c?

0 Answers  


what will be the output for the following main() { printf("hi" "hello"); }

5 Answers   RoboSoft,


how to add our own function in c library please give details.?

1 Answers   TCS,


can please someone teach me how to create this program using while statement.. this is the output should look like 0 2 4 6 8 10 -thanks.. :) need it asap...

7 Answers  


How can I increase the allowable number of simultaneously open files?

1 Answers   CSC,


main() { int i=5; printf("%d%d%d%d",i++,i--,i); }

10 Answers  


Stimulate calculators to perform addition,subtraction,multiplication and division on two numbers using if/else statement?

1 Answers   IBM,


Categories