Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
C Program for SWAPPING THE STRING
#include conio.h>
#include stdio.h>
void main()
{
char a[50],temp=0;
int i=0,c=0,c1=0,l=0;
clrscr();
printf("ENTER THE STRING= ");
flushall();
do
a[i++]=getchar();
}while(a[i-1]!='\n');
a[i]='\0';
for(i=0;a[i]!='\0';i++)
if(a[i]==' ' || a[i]=='\n')
c++;
}
printf("\nTHE TOTAL NO OF WORDS BEFORE SWAPING IS %d\n\n",c);
l=strlen(a);
l--;
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
i++;
for(i=0;a[i]!=0;i++);
if(l%2!=0)
temp=a[i-2];
a[i-2]=a[i-1];
a[i-1]=temp;
else
a[i]='\n';
a[i+1]='\0';
printf("%s",a);
c1++;
printf("\nTHE TOTAL NO OF WORDS AFTER SWAPING IS %d\n\n",c1);
getch();
OUTPUT :
ENTER THE STRING: KAMLESH D MENGAR
THE TOTAL NO OF BEFORE SWAPPING 3
AKLMSE H DEMGNRA
THE TOTAL NO OF AFTER SWAPPING 3
how would land elevation have changed if Coronado had traveled 150 miles due west from what is today Arizona instead of east toward New Mexico
A: Depends. Might be "zero" Objects which are thrown must have a publicly accessible copy-constructor. The compiler is permitted to generate code which copies the thrown object
The goto statement This statement can be used to branch to another statement of the program. This is rarely used as it violates the principle of structured programming. Though
Hello. I need a solution for this assignment. It is for C++ Language: Create a BusinessPartner class that contains a first name, company name, and a telephone number. Create a Con
How to I start the programm
It is a pointer accessible only in the member functions of a struct, class or union type. It points to the object for which the member function is called. Static member functions d
Program is to search for a given character in a string: Program is to search for a given character in a string and print point of match char *stsearch(char *string, char sea
Aim: To implement a program to maintain information of employees in an educational institute using inheritance. Code: class staff {
When I develop a destructor, do I require to explicitly call the destructors for my member objects?
You're going to simulate a metropolitan subway train. The train system will start out at Station #1, or Home Station, and will service multiple stations along its route.
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd