Computer Science, asked by vivekyadav1010don, 11 months ago

)Enter a number. If the number is less than 100 add 99 to the number otherwise
subtract 99 from the number and print the result.​

Answers

Answered by Sachin5452
0

Answer:

#include<iostream.h>

#include<conio.h>

void main()

{

Int a,b;

cout<<"enter the no. ";

cin>>a;

if(a<100)

{

b=a+99;

cout<<b;

}

else

{

b=a-100

cout<<b;

}

getch();

}

.......Hope this will help you

Answered by AskewTronics
0

Python program:

Explanation:

number=int(input("Enter the number: "))#Take input from the user.

if(number<100):#check the number is less than 100 or not.

   number=number+99

else:

   number=number-99

print(number)#print the result.

output:

  • If the user input 1, then it will prints 100.
  • If trhe user input 100, then it will prints 1.

Code Explanation:

  • The above code is in python language, in which the first line of the code is used to take the input from the user.
  • Then the if condition will check that the number is less than 100 or not.
  • If it is less than 100, then 99 will be added otherwise 99 will be subtracted from the number and the result will be rendered by the help of print function.

Learn More:

  • Python : https://brainly.in/question/14689905

Similar questions