n=18
number_of_guesses=1
print("Number of guesses is limited to only 9 times: ")
while (number_of_guesses<=9):
guess_number = int(input("Guess the number :\n"))
if guess_number<18:
print("you enter less number please input greater number.\n")
elif guess_number>18:
print("you enter greater number please input smaller number.\n ")
else:
print("you won\n")
print(number_of_guesses,"no.of guesses he took to finish.")
break
print(9-number_of_guesses,"no. of guesses left")
number_of_guesses = number_of_guesses + 1
if(number_of_guesses>9):
print("Game Over")
#include<stdio.h> //24. Write a C Program to Demonstrate the Working of Keyword long. void main() { int a; long b; long long c; double e; long double f; printf(" The size of int = %ld bytes \n", sizeof(a)); printf(" The size of long = %ld bytes\n", sizeof(b)); printf(" The size of long long = %ld bytes\n", sizeof(c)); printf(" The size of double = %ld bytes\n", sizeof(e)); printf(" The size of long double = %ld bytes\n\n", sizeof(f)); }
Hello
ReplyDelete