Honestly , brainly may seem like a place to get answers but it’s not , people come here to troll, like me
One which is open source, linux based
Answer:
Python Code:-
#creating a list
current_members = [4, 6, 9]
#defining the variable
#assigning the value
member_id = 9
#defining variable count
count = 0
#defining the variable and setting initial value to true
is_a_member = False
#for loop is used to iterate over the list
for x in current_members:
#if statement will check whether the element is found
if x == member_id:
#set the value to true if the value is matched
is_a_member = True
#set the value to 1
count = 1
#if count == 0
#set the value of is_a_member variable to false
if count == 0:
is_a_member = False
#print the current value stored in is_a_member variable
print(is_a_member)
Explanation:
In the above python program, a list is created that is "current_members" and some values are inserted. In the next line, a three-variable is defined that are member_id, count, and is_a_member.
- In both variable member_id, count assigns some value. and in is_a_member variable assign a False value.
- Using a for loop to iterate over the list.
- Inside the loop, If the statement will check whether the element is found. Then set the value of is_a_member variable to True and count to 1.
- Another if the statement is used which checks the value of the count variable. If the value of count is 0 then set the value of is_a_member to False.
- print() function is used to display the current value of is_a_member variable.
Cropping an image is resizing it to different ratios to suit your needs.
Answer:
See Explaination
Explanation:
#include <iostream>
#include <string.h>
using namespace std;
char *mixem(char *s1, char *s2);
int main() {
cout << mixem("abc", "123") << endl;
cout << mixem("def", "456") << endl;
return 0;
}
char *mixem(char *s1, char *s2) {
char *result = new char[1 + strlen(s1) + strlen(s2)];
char *p1 = s1;
char *p2 = s2;
char *p = result;
while (*p1 || *p2) {
if (*p1) {
*p = *p1;
p1++;
p++;
}
if (*p2) {
*p = *p2;
p2++;
p++;
}
}
*p = '\0';
return result;
}