Answer:
Option C. Security+ is the correct answer.
Explanation:
Solution :
#include
#include
#include
//Converts
to binary string.
* hexadecimal
Binary(char* hexdec)
{
long
= 0;
char *string =
(sizeof(char) * 9);
while (hexdec[i]) {
//Simply assign binary string for each hex char.
switch (hexdec[i]) {
strcat(string, "0000");
break;
strcat(string, "0001");
break;
strcat(string, "0010");
break;
strcat(string, "0011");
break;
strcat(string, "0100");
break;
strcat(string, "0101");
break;
strcat(string, "0110");
break;
strcat(string, "0111");
break;
strcat(string, "1000");
break;
strcat(string, "1001");
break;
case 'A':
case 'a':
strcat(string, "1010");
break;
case 'B':
case 'b':
strcat(string, "1011");
break;
case 'C':
case 'c':
strcat(string, "1100");
break;
case 'D':
case 'd':
strcat(string, "1101");
break;
case 'E':
case 'e':
strcat(string, "1110");
break;
case 'F':
case 'f':
strcat(string, "1111");
break;
default:
printf("\nInvalid hexadecimal digit %c",
hexdec[i]);
string="-1" ;
}
i++;
}
return string;
}
int main()
{ //Take 2 strings
char *str1 =hexadecimalToBinary("FA") ;
char *str2 =hexadecimalToBinary("12") ;
//Input 2 numbers p and n.
int p,n;
scanf("%d",&p);
scanf("%d",&n);
//keep j as length of str2
int j=strlen(str2),i;
//Now replace n digits after p of str1
for(i=0;i<n;i++){
str1[p+i]=str2[j-1-i];
}
//Now, i have used c library strtol
long ans = strtol(str1, NULL, 2);
//print result.
printf("%lx",ans);
return 0;
}
Answer: the acheve stuff
Explanation: that person is not an achiever if they dont achieve their goals
Answer:
Following are the code to this question:
def get_initials(the_name): #defining a method get_initials
name = the_name.split(" ") #defining name variable that splits value
val = ''#defining a string variable val
for n in name: #defining loop to convert value into upper case and store first character
val = val + n[0].upper() + "." # use val variable to hold value
return val # return val
print(get_initials("Gloria kind of a big deal Tropalogos"))#call method and print return value
print(get_initials("Homer J Simpson"))#call method and print return value
print(get_initials("John Q Public")) #call method and print return value
Output:
J.Q.P.
H.J.S.
G.K.O.A.B.D.T.
Explanation:
In the given code, the last is incorrect because if we pass the value that is "Gloria kind of a big deal Tropalogos" so, will not give G.O.O.D. instead of that it will return G.K.O.A.B.D.T. So, the program description can be given as follows:
- In the given python code, a method "get_initials" is declared, that accepts "the_name" variable as a parameter, inside the method "name" variable is declared, which uses the split method that splits all values.
- In the next step, a string variable "val" and for loop is used, in which the "val" variable converts the first character of the string into the upper case and stores its character with "." symbol in "val" variable and return its value.
- In the last step, the print method is used, that passes the string value and prints its sort value.