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