Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write an algorithm to get a sentence and reverse it in the
following format:
input : I am here
opuput: Here Am I
note: first letter of every word is capiatlised

Answer Posted / anshu ranjan

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

void main()
{char *s,*t;
int i=0,j=0;
s=(char *)malloc (1000*sizeof(char));
t=(char *)malloc (50*sizeof(char));
gets(s);
i=strlen(s)-1;
while(i>=-1)
{
if(s[i]!=' ' && i>=0)
t[j++]=s[i--];
else {if(t[j-1]>=97 && t[j-1]<=122)
t[j-1]-=32;
i--;
t[j]=0;
//printf("%s ",t);
strrev(t);
printf("%s ",t);
j=0;
}
}
}

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c weakly typed?

968


What is a class c rental property?

1041


What is the time and space complexities of merge sort and when is it preferred over quick sort?

1013


What is the significance of scope resolution operator?

1347


difference between Low, Middle, High Level languages in c ?

2024


What is the correct declaration of main?

1154


What is the advantage of using #define to declare a constant?

1037


Can you please explain the difference between exit() and _exit() function?

993


By using C language input a date into it and if it is right?

1021


What are the 4 types of programming language?

1049


please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com

1722


What is the scope of static variable in c?

944


What is type qualifiers?

1079


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1646


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

2155