A program to change the string ‘this is c programming’ in the given format.
A program to change the string ‘this is c programming’ in the given format.
Codes
/*A program to change the string ‘this is c programming’ in the given format*/
/*Programed by Jitendra Kr Yadav
10116
22 Mar,2011*/
#include<stdio.h>
#include<conio.h>
void format(char[]);
main()
{
char str[]=” this is c programming”;
format(str);
getch();
}
void format(char string[])
{
int i;
for(i=0;string[i]!=’\0′;i++)
{
if(string[i]==’ ‘)
{
printf(“\n”);
string[i+1]=string[i+1]-32;
}
else
printf(“%c”,string[i]);
}
printf(“\n\n”);
printf(“Press any key to continue…”);
}
Output
This
Is
C
Programming
Press any key to continue…