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
What is the difference between = symbol and == symbol? - The = symbol is generally used in mathematical operations. It's used to assign a value to a given variable whereas the
Write a program which incorporates a function named compute and which is used to calculate the area and circumference of a circle. Use the main function for inputs and outputs.
C program for bubble sort: void main() { int i,j,k,a[10],n; clrscr(); printf("How many values you want to enter\n"); scanf("%d",&n); for(i=0;i { pri
#questionAt a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets
boardcoloring with minimum color of 4
In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color. Fill the other elements in the board, suc
v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Normal 0
#include long BixFunction(int x, int y = 5, float z = 5) { return(++x * ++y + (int)++z); } int main() { cout return 0; }
You are given a collection of words, say as in a dictionary. You can represent it in the following compressed form: the first word will be followed by a sequence of a pair of numbe
A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome
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: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd