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 : –

[codesyntax lang=”c” lines=”normal”]

#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();
}

[/codesyntax]

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