Guessing Game In C
This is a small guessing game written in C. In this guessing game you have to guess a number between 0 & 100. You have 8 chances to do that. Every time you guess wrongly the program will give you a hint that your guess is too high or your guess is too low. Based on this hint you have to guess the number in the remaining attempts. Here’s the code
#include<stdlib.h>
#include<time.h>
void main()
{
int num,guess=-1,tries=0,pass=0;
time_t t;
srand((unsigned)time(&t));
num=rand()%100;
while((guess!=num)&&tries<8)
{
printf(“Enter the guess num b/w 0 & 100 (you have %d tries left out)\n”,(8-tries)); scanf(“%d”,&guess);
tries++;
if(guess==num)
{
printf(“Hurray you guessed it correctly!!!\n”);
pass=1;
}
else if(num< guess)
printf(“Your guess is too high\n”);
else
printf(“Your guess is too low\n”);
}
if(pass==0)
printf(“Sorry you lost! The correct number is %d\n”,num);
}
Popularity: 1% [?]
By using/following this site you agree to our Legal Disclaimer


THis actually worked. I have been working on this project for a simple game program and could not figure out what i was doing wrong. I am using Miracle C compiler and thought it was the compiler but soem of the code ideas here helped me to identify my issues. Thanks
that’s good
yea but what about for complete beginners, im guessing past in ntoepad save as “blabla.c”? or .exe i have no idea?!? help me!
hi srikant u r superb.
this really helps me a lot.
hi srikanth its really superb……..
i am inspired by you that now i’m intresting to knw abt hack something blabla….. till now i have no idea to study abt anything
but after visiting ur site,it inspire for getting to know abt something abt hack ………. thanks u re really well…………..
your guidance is useful for everyone……thanks hats off……
hi Srikanth !! u r the undisputed man !! but am real a beginer and i wanna know !! so should i
copy this copy this source code into the note pad and the wat follows…please!! help me
Hy Bro….
I want to install Borland C
in 64 Bit Processor
Is it possible???
Pls rply me on aqib160492@gmail.com
This site is mostly a stroll-by means of for all of the information you needed about this and didn?t know who to ask. Glimpse right here, and you?ll definitely discover it.
Leave your response!
EMAIL SECURITY »
What to Do When Your Email Account is Hacked?
How to Recover Hacked Email Accounts?
It can be a real nightmare if someone hacks and takes control of your email account as it may contain confidential information like bank logins, credit card details and other sensitive data. …
HOW STUFFS WORK »
How Antivirus Software Works
Due to ever increasing threat from virus and other malicious programs, almost every computer today comes with a pre-installed antivirus software on it. In fact, an antivirus has become one of the most essential software package for every computer. Even though every one …
HOW-TO GUIDES »
How to Hide Data in Image, Audio & Video Files: Steganography
Ever wondered to know how to hide secret messages in images, audio and video files? Well, in this post I will take you through a concept called steganography using which, it is possible to hide your secret information …
INTERNET SECURITY »
How to Hide Data in Image, Audio & Video Files: Steganography
Ever wondered to know how to hide secret messages in images, audio and video files? Well, in this post I will take you through a concept called steganography using which, it is possible to hide your secret information …
NETWORK HACKS »
How to Hack an Ethernet ADSL Router
Almost half of the Internet users across the globe use ADSL routers/modems to connect to the Internet however, most of them are unaware of the fact that it has a serious vulnerability which can easily be exploited even by a …
Categories
Most Popular
Most Commented
Blogroll
Log In | Entries (RSS) | Comments (RSS) | Sitemap
© 2008-2011 GoHacking.Com. This content is copyrighted to Srikanth and may not be reproduced on other websites.