Write a simple python function to increase the value of any number by a constant "C=5" and write another simple function to update the value of "C" to any other value like 6,7,8, etc.
# The required output is as:
The incremented number is:
15
The incremented number is:
110
Answers
Answered by
14
Answer:
C=5
def incrementbyC(num):
num=num+C
print(num)
def updateC(a):
C=a
print "The incremented number is:"
incrementbyC(10)
print "The incremented number is:"
updateC(100)
incrementbyC(10)
Explanation:
Answered by
0
Explanation:
Python is a famous programming language, one reason is the simplicity in its syntax and it is extremely well developed language.
The given code in python is;
Int C = 5
def constant_addition(num):
{
global C
added_word = num + c
print(added_word)
}
def revised_word(num):
{
global C
C = num
print(C)
}
Int main void
{
Int number;
number = input("Enter a number: ")
print ("The new number after increment is:")
constant_addition(number):
print ("Updated value of C constant is:")
revised_word(number):
}
Similar questions