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
1. The shell must support the following internal commands: i. cd - Change the current default directory to . If the argument is not present, report the current directory. If t
Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''''''''{'''''''' and end wi
Explain string constants in c language - Escape Sequences? Illustrations are "945", "hello", "well done", "5+3". The character constant (example 'x') isn't equivalent to the st
in this problem u given a board in which some of the elements are placed as shown in diagram below .each element represent a color .fill the other elements in the board such that n
Write a main program that uses these system calls to echo the typed characters. The pseudo code will look something like: void traphandler () { if (R0 == 0) { // read sys
recursive sub programs
How must runtime errors be handled in C++ - Runtime errors in C++ can be handled using exceptions. - This exception handling mechanism in C++ is developed to handle errors i
#include #include #include #include #include class Employee { private: char *Name; //Set them as pointers... int IdNumber; char *Department; char *Position; public: voi
Write a recursive function recursiveMin that takes an integer array, a starting subscript and an ending subscript as arguments, and returns the smallest element in the array. The f
Describe problem with Runtime type identification? A: The run time kind identification comes at cost of performance penalty. Compiler maintains class.
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