jituTechnology

jituTechnology

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…

No comments yet.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

April 2024
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930