Yes, it is possible to get a virus just by opening an e-mail only if your e-mail client allows scripting. You commonly get the virus if you click a link or an attachment from the e-mail.
Answer:
(10000000)₂ = -128 in decimal
(11001100)₂ = -52 in decimal
(10110111)₂ = -73 in decimal
Explanation:
<u>NOTE:</u> If Most Significant Bit is 0, it is positive number and if MSB is 1, it is negative number. If number is positive we can simply convert it to decimal. But if number is negative, follow following formula:
- (complement of the number) +1
<u>EXAMPLE 1</u>
(10000000)₂
(01 1 1 1 1 1 1)₂ ↔ complement of the number
<u>+ 1</u>
(10000000)₂ = 1 ×= 128 (magnitude in decimal)
But we remember MSB was 1 so answer is -128.
<u>EXAMPLE 2</u>
(1 1 0 0 1 1 00)₂
(0 0 1 1 0 0 1 1)₂
<u>+ 1 </u>
(0 0 1 1 0 1 0 0)₂ = 52 (magnitude in decimal)
But we remember MSB was 1 so answer is -52.
<u>EXAMPLE 3</u>
(1 0 1 1 0 1 1 1)₂
(0 1 00 1 000)₂
<u>+ 1 </u>
(01 00 1 00 1)₂ = 73 (magnitude in decimal)
But we remember MSB was 1 so answer is -73.
Answer:
Written in C:
#include <stdio.h>
#include <strings.h>
int main(){
char userinput[100];
printf("Enter a message: ");
scanf("%s",&userinput);
int lent = strlen(userinput);
for (int i=lent-1; i>=0; i--)
printf("%c",userinput[i]);
return 0;
}
Explanation:
This line declares a string variable
char userinput[100];
This line prompts user for input
printf("Enter a message: ");
This line gets user input
scanf("%s",&userinput);
This line calculates the length of user input
int lent = strlen(userinput);
This iterates through the characters of user input
for (int i=lent-1; i>=0; i--)
This prints the characters in reverse
printf("%c",userinput[i]);
A database
------------------------------------