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
Inline Functions Imagine a c program, which reads disk records having employee information. If this is a payroll application each employee record data is probably processed by
color representation 0,1,2,3,4,5,6,7,.......
how many values we can return from pointer to function?
The project will include Arena models (only .doe files) and MSWord document for the report. Thereport must contain the following sections: 1. Introduction: (a) Statemen
Explain procedural logic A procedure, or function, was explained as a set of specific instructions implemented in sequential manner. The data is kept separate from the procedur
Write a function for finding out highest and lowest marks obtained by a student from an array contained student name and marks. For Example : GetHighestLowestMarks{Student{n}, Ma
#Hi, I''m planning to derive the escape velocity through C++. I would just like to know if it''s possible to differentiate symbolic functions? Do I need to download libraries,etc?
How to I start the programm
Hello I''m new to programming, and I''m making now my 1st program. My question is how to put substr in textbox that question mark should be at the end of sentence? And 2nd question
what is the diffeerence between c and c++
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