Write a program to accept two strings of Odd lengths. Then
take all odd characters from one string and even characters
from the other and concatenate and produce a string.
Answer / mani
#include<stdio.h>
void main()
{
char *str1[10],*str2[10],str3[10],str[4];
boolean check1,check2;
int i=0,j=1;
do
printf("enter the first string of odd length");
scanf("%s",str1);
printf("enter the second string of odd length");
scanf("%s",str2);
check1=testlen(&str1);
check2=testlen(&str2);
}
while(check1!=true && check2!=true);
while( *str1!='/o' || *str2!='/o')
{
if(str1[i]!='/o)
str3[i]=str1[i];
if(str2[i]!='/o)
str3[i+1]=str2[i];
i+=2;
}
while( *str1!='/o' || *str2!='/o')
{
if(str1[j]!='/o)
str4[j]=str1[j];
if(str2[j]!='/o)
str4[j+1]=str2[j];
i+=2;
}
printf("The value of string1 is %s",str1);
printf("The value of string1 is %s",str2);
printf("The value of string1 is %s",str3);
printf("The value of string1 is %s",str4);
}
boolean testlen(char *c) //function
{
int count;
while(*c++!='/o')
count++;
if(count%2!=0)
return true;
else
return false;
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Write a program to accept two strings of Odd lengths. Then take all odd characters from one string and even characters from the other and concatenate and produce a string.
How to create a program that lists the capital country when told what the original country is? (Terribly sorry, I'm a novice programmer and would appreciate any help ;). Cheers, Alexxis
what is syntax error?
Write a c-programe that input one number of four digits and find digits sum?
char* f() return "hello:"; void main() {char *str=f(); }
UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....
Given that two int variables, total and amount , have been declared, write a sequence of statements that: initializes total to 0 reads three values into amount , one at a time. After each value is read in to amount , it is added to the value in total (that is, total is incremented by the value in amount ). Instructor's notes: If you use a loop, it must be a for loop. And if you use a loop control variable for counting, you must declare it.
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
What are the different types of errors in C and when they occur?
#include<stdio.h> void main() { int i=1; printf("%d%d%d",i++,++i,i); }
printy(a=3,a=2)
write a profram for selection sort whats the error in it?