Answer:
// This program is written in C++ programming language
// Comments are used for explanatory purpose
// Program starts here
#include <iostream>
#include <string>
using namespace std;
// Declare variables
int inputvar;
// Declare output variable as array
int outputvar[32];
// Set a counter for binary array
int i = 0;
while (inputvar > 0) {
// Divide inputvar by 2 and store remainder in outputvar
outputvar[i] = n % 2;
inputvar/=2;
i++; // increment i by 1
}
// End of division
// Prin resulting array in reverse order
for (int j = i - 1; j >= 0; j--) {
cout << outputvar[j];
}
return 0;
}
// End of Program
Answer:
Following are the program in the Python Programming Language:
def check(num): #define function
if(num.isdigit()): #set if statement
return "yes"; #return yes if condition is true
else:
return "no";# return no if condition is false
string=input("Enter the numbers 0-9: ") #get input from the user
print(check(string)) #print and call the function
Output:
Enter the numbers 0-9: 1995
yes
Enter the numbers 0-9: 42,000
no
Explanation:
Here, we define a function "check()" and pass an argument in its parameter "num" inside the function.
- we set if-else conditional statement and check the value stored in the variable "num" is the digit by using built in function "isdigit()" then return "yes".
- Then, otherwise it return "no".
Finally, we get the input from the user in the variable "string" then, we call the function through "print()" function.
Answer:
The answer is "True".
Explanation:
In the given question option is missing, that is "true or false", which can be described as follows:
In the given question, it is declared, that an "arrays12.java" program file is declared So, the class name is "arrays12" because in java class name and the program file name is the same.
- Inside the class, a swap method is called, that first accepts value.
- After accepting the value it is defined as another variable, that swap variable values, that's why the answer to this question is true.
Answer:
no you should not force a cpu into its socket.
Explanation: on an intel platform the pins are on the motherboard, therefore if you force it in it will damage the pins on the motherboard, and on AMD the pins are on the cpu itself so you can damage the extremely fragile pins on it, you can not shock your cpu however like the other answer.