vishal.cs.bits
BAN USER
//program to print the string in the reverse order but not the words present in it
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void reverse(char * arrayin);
void rev_words(char * arrayin);
int main()
{
printf("Enter the string\n");
char input[100];
gets(input);
reverse(input);
rev_words(input);
printf("The output is:\n");
puts(input);
return 0;
}
void reverse(char * arrayin)
{
int i;
int length;
char temp;
length = strlen(arrayin);
for(i=0;i<(length/2);i++)
{
temp = *(arrayin+i);
*(arrayin+i) = *(arrayin+length-1-i);
*(arrayin+length-1-i) = temp;
}
}
void rev_words(char * arrayin)
{
int i,length, count,lengthx;
int start, end,m,j;
char temp;
count = 0;
j = 0;
length = strlen(arrayin);
for(i=0; i<length; i++)
{
if(arrayin[i]==' ')
{
count = count + 1;
}
}
start = 0;
end = 0;
for(i=0;i<length;i++)
{
j = 0;
if(arrayin[i]==' ' || i == (length-1))
{
if(i!= (length-1))
{
end = i - 1;
}
else if(i == (length-1))
{
end = i;
}
lengthx = end - start + 1;
for(m=start; m <= (start - 1 + lengthx/2); m++,j++)
{
temp = arrayin[m];
arrayin[m] = arrayin[end - j];
arrayin[end - j] = temp;
}
start = i + 1;
}
}
}
RepAtiDavis, Analyst at 8x8
I am a skilled construction worker with 3+ years of experience erecting structures according to blueprints and safely utilizing power ...
RepLoisHarvey, Apple Phone Number available 24/7 for our Customers at Absolute Softech Ltd
Working as a Content editor it's almost 10 years at Deco Refreshments, Inc. As a content editor is someone ...
RepAadhikLee, abc at 8x8
Expedite data entry efforts and bank reconciliation under the direct guidance of the senior accountant, ensuring clean, accurate financial records ...
RepYuvaanSmith, Analyst at ADP
Monitor and coordinate project information as it relates to the finances of the organization both before, during, and after bringing ...
RepJesseCarlson, Cloud Support Associate at Alfa Chemaical Laboratory
Jesse , a video producer with 4 years of experience in running production processes from start to finish. Excellent at client ...
RepCecilRenteria, Managing editor at Alliance Global Servies
A Managing Editor, or Content Manager, I" m creates content strategies and oversees their implementation processes. spent 2/3 years ...
RepJohnHentz, Animator at Abs india pvt. ltd.
JohnHentz is a Responsible Financial planner working at Plan Smart Partner . i Analyze clients' financial statuses income, expenses and liabilities ...
RepMinnieRuffin, Accountant at Boomerang Commerce
Minnie , a business leader professional accustomed to managing projects with Vashikaran Specialist in nagpur pay after results with fast-paced and ...
Reprothymellen, Consultant at Accolite software
I am a Correctional officer . I have the primary role of maintaining order within a detention facility. My hobby is ...
RepMiaDavis, abc at 8x8
I have excellent communication skills that allow me to effectively lead my team and convey my ideas to them so ...
Repnetteyoder22, Applications Developer at 247quickbookshelp
Nette, transportation inspector inspects goods and equipment associated with transporting people or cargo to ensure safety. I typically work for ...
RepCecilPonton, Java Developer at Boeing
Cecil , an enthusiastic professional Photographer with 2 years of experience with a true passion for capturing life’s moments through ...
RepHenryBrown, Associate at A9
I am an experienced budget analyst skilled at researching and consolidating financial and budget information. I am taught record keeping ...
RepFannieRamirez, Accountant at A9
I am a technically skilled Payroll bookkeeper responsible for the full charge bookkeeping function. My expertise includes knowledge of accepted ...
RepYaniraBryant, Accountant at CGI-AMS
I am Yanira , a writer by fate. Went from writing for media outlets to exploring the world of content creation ...
Repgeachfadden9, cox customer service at Chicago Mercantile Exchange
Geach, my responsibilities include making travel and meeting arrangements, preparing reports and maintaining appropriate filing systems. I have excellent oral ...
Replleongardner, Animator at 247quickbookshelp
I am a writer and television producer living in the Corpus Christi area. I have always been fascinated by the ...
RepRileyLopez, Android Engineer at A9
I am working as a network administrator in a technical support company. I planned and recommended network hardware, systems, management ...
Repcolleenpbeverly02, Android test engineer at ABC TECH SUPPORT
Hello I am Colleen Dedicated and hardworking Geographic information specialist analyst with 15 years of experience working with ArcGIS software ...
Repdebrak836636, Developer Program Engineer at Arista Networks
I am Debra , a multilingual (English/Italian/French) Judge with 5 years of experience in presiding over court proceedings, prosecuting ...
RepOishiGreen, Android test engineer at ABC TECH SUPPORT
I am a results-oriented debt collector with 3 years of experience and knowledge in the leasing/finance sector. I have ...
RepDessieBieri, Human Resource Executive at Bazaarvoice
I am Dessie, an academic advisor with more than 2 years of extensive field experience and a well-developed industry knowledge ...
There are two algorithms here : quickunion and quickfind.
- vishal.cs.bits October 13, 2014If we use quickfind, it will be kind of slow, if we have to add the pairs.
it will be a better choice if we use quickunion!