Write a program in ‘C’ to print the following format: 10m Dec2005

By | June 4, 2014

Write a program in ‘C’ to print the following format: 10m Dec2005

I
I G
I G N
I G N O
I G N O U
I G N O
I G N
I G
I

#include<stdio.h>
void main()
{
char C[]=”IGNOU”;
int I,J;
clrscr();
printf(“Result :\n”);
for(I=0;I<5;I++)
{
printf(“\n”);
for(J=0;J<=I;J++)
{
printf(“%c “,C[J]);
}
printf(“\n”);
}
for(I=3;I>=0;I–)
{
printf(“\n”);
for(J=0;J<=I;J++)
{
printf(“%c “,C[J]);
}
printf(“\n”);
}
getch();
}

CODE : -

  1. #include<stdio.h>
  2. void main()
  3. {
  4. char C[]="IGNOU";
  5. int I,J;
  6. clrscr();
  7. printf("Result :\n");
  8. for(I=0;I<5;I++)
  9. {
  10. printf("\n");
  11. for(J=0;J<=I;J++)
  12. {
  13. printf("%c ",C[J]);
  14. }
  15. printf("\n");
  16. }
  17. for(I=3;I>=0;I--)
  18. {
  19. printf("\n");
  20. for(J=0;J<=I;J++)
  21. {
  22. printf("%c ",C[J]);
  23. }
  24. printf("\n");
  25. }
  26. getch();
  27. }

SCREEN SHOTS :-

C_program_Print_IGNOU

C_program_Print_IGNOU_Output

Q  Write a program to count the number of vowels, consonants and spaces in a given string. 10m Dec2005 

Solved program can be found on this link http://cssimplified.com/c-programming/a-c-program-to-count-number-of-vowels-consonants-spaces-in-a-given-string

Leave a Reply