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!
Program is to replace every occurrence of in a string:
Program is to replace every occurrence of c1 in string with c2 and have function return the no. of replacement
int replace(char *s,char c1,char c2);
void main()
{
clrscr();
char *s,c1,c2;
int ans;
cout<<" enter a string ";
gets(s);
cout<<" enter the string to be searched ";
cin>>c1;
cout<<" enter the string to be replaced ";
cin>>c2;
ans=replace(s,c1,c2);
cout<<" the no. of replacement made "< cout<<" the string after replacement being made :"< } int replace (char *s,char c1,char c2) { int i=0; int count=0; while(s[i]!= NULL) { if (s[i]==c1) { s[i]=c2; count++; } i++; } return count; }
cout<<" the string after replacement being made :"<
}
int replace (char *s,char c1,char c2)
int i=0;
int count=0;
while(s[i]!= NULL)
if (s[i]==c1)
s[i]=c2;
count++;
i++;
return count;
Inline function: It is a function without prototype. The function is defined above main. The function should be declared above main function. Declaring
A PROGRAM TO CALCULATE AREA OF TRIANGLE
What is the difference between an external iterator and an internal iterator? Ans) An internal iterator is executed with member functions of the class that has items to step th
Program to store family members details in C++: #include #include #include struct record { char name[30]; int age; char state[40]; }x; //cal
Develop a program to meet the following requirements: 1. Must use at least one function in addition to main (you can use more) 2. Must use selection 3. Must use deference/indire
Inline functions, C++ provides inline functions to help reduce function_call overhead especially for small functions. The qualifier inline before function's return type in the f
Define global variable in c++ program: How to define a global variable and need of global variable in c++ program. int main() { int m=20; clrscr(); for
I need help programing this... In this exercise, you will create a program for the sales manager at Computer Haven, a small business that offers motivational seminars to local comp
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
what is a string?
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