C Program For Guess

#include<conio.h>
#include<stdio.h>
main()
{clrscr();float guess, incr;
char ch;
incr=guess=100;
while (incr>1)
{ printf("\ng or l %0f\n",guess);
  incr=incr/2;
  if( (ch=getch())=='e')
  break;
  else if (ch=='g')
  guess=guess+incr;
  else
  guess =guess-incr;
  }
  printf("\nno is %.0f. ",guess);
  getch();}
Bhanu Namikaze

Bhanu Namikaze is an Ethical Hacker, Security Analyst, Blogger, Web Developer and a Mechanical Engineer. He Enjoys writing articles, Blogging, Debugging Errors and Capture the Flags. Enjoy Learning; There is Nothing Like Absolute Defeat - Try and try until you Succeed.

No comments:

Post a Comment