Sjsjsjsjsjdhshshshshususs
Answer:
No
It just let us see moving but actually they doesn't move
Answer:
The solution code is written in Python 3
- digits = input("Enter 9 digits: ")
-
- multiplier = 1
- total = 0
-
- for x in digits:
- total += int(x) * multiplier
- multiplier += 1
-
- checksum = total % 11
-
- if(checksum == 10):
- print(digits + "X")
- else:
- print(digits + str(checksum))
Explanation:
Firstly, use input function to get user input for 9 digits (Line 1)
Next we can use a for-loop to estimate the summation (d1 * 1 + d2 * 2 + d3 * 3 + d4 * 4 + d5 * 5+ d6 * 6 + d7 * 7 + d8 * 8 + d9 * 9) ( Line 6-8)
Then only apply % operator to get the remainder of total and get the checksum (Line 10)
Next create if and else statement to print the digits string joined with X if checksum is 10 else join digits string with checksum value (Line 12 -15)
Answer:
A variable is a name associated with a data value; we say that the variable "stores" or "contains" the value. Variables allow us to store and manipulate data in our programs.
Answer:
#include <iostream>
using namespace std;
int main()
{
string str;
cout<<"Enter the string: ";
cin>>str;
for(int i=0;str[i]!='\0';i++){
if(str[i]=='e'){
str[i]='x';
}
}
cout<<"the string is: "<<str<<endl;
return 0;
}
Explanation:
First, include the library iostream for using the input/output instructions.
Create the main function and declare the variables.
Then, use the cout instruction and print the message on the screen.
cin store the string enter by the user into a variable.
After that, take a for loop and if-else statement for checking the condition if the string contains the 'e', then change that alphabet to 'x'.
This process continues until the string not empty.
Finally, print the updated string.