Answer:
int1=int(input("Enter integer :\n"))#taking input of first number.
int2=float(input("Enter the power :\n"))#taking input of the power.
if int2 == 0.5 and int1<0:#condition for negative square root.
print("Cannot calculate the square root of negative numbers")#printing the message.
else:#else calculating the result.
res=int1**int2
print(res)
output:-
Enter integer :
-5
Enter the power :
0.5
Cannot calculate the square root of negative numbers
Explanation:
In the above program I have taken input of the number and the power.Since power can be decimal number taking it as float.If the number is negative and the power is 0.5 then printing the message for not calculating the value else calculating the value and storing it in the res printing the res.
Answer:
The answer to this question as follows:
Explanation:
- In the given code an integer pointer variable "intPointer" is declared, this variable holds an integer type value, which is "500". In the next step, the pointer variable initialized a value with 10, which is illegal, because in pointer we hold the address of variable, not the value, that's why it will give segmentation fault.
- This fault will arise when the common condition triggering crashed systems, it often linked to the main script, that Safeguards are triggered by a program, that tries to read or write an illegal place in storage.
telecommunications is just one other term. there's also industrial science or automation
Answer:
provides the platform that application software runs on, manages a computer's hardware, and implements features like file and folder management.
Explanation:
Answer:
The program to this question as follows:
Program:
PRINT "Program: Area of Triangle" 'print message
INPUT "Enter base: ", base 'defining the variable base and input value from the user
INPUT "Enter height:",height 'defining variable height and input a value from user
Area=base*height/2 'formula to calculate Area
PRINT "Area of Triangle:", Area 'print Area
Output:
Program: Area of Triangle
Enter base: 2
Enter height: 3
Area of Triangle: 3
Explanation:
In the above Qbasic program, first, a print function is used to print the message.
In the next line, the input function is defined, which uses the "base and height" variable for user input.
Then another variable "Area" is defined that uses user input values to calculate the area of a triangle, and also store its calculated value. At the last, the print function is used to print Area variable value