Anda di halaman 1dari 12

“GUESS THE NUMBER GAME USING

C”

SUBMITTED BY

JOHN PRANOY (15241A0257)

ATHISH CHOWDARY (15241A0254)

YENISETTY GOPAL (15241A0259)

Y KRUSHNA (15241A0258)

Gokaraju Rangaraju Institute of Engineering and Technology

(Affiliated to Jawaharlal Nehru Technological University)

Hyderabad-500090

Department of Computer programming and Data structures

[Para Rajesh] [Dr.B.Srinivasa rao] [Dr.J.N.Murthy] [Dr.P.S.Raju]

GUIDE IN-CHARGE PRINCIPAL DIRECTOR

I
ACKNOWLEDGEMENT

We express our deep sense of gratitude to our beloved Director


Dr.P.S.Raju, Gokaraju Rangaraju Institute of Engineering and Technology For the
valuable guidance and for permitting us to carry out this project.

With immense pleasure, we record our deep sense of gratitude to our


beloved Principal, Dr.J.N.Murthy for permitting us to carry out this project.

We are thankful to IN-CHARGE Dr.B.srinivasa rao , CPDS Department


for providing us appropriate environment required for the project to complete

.We are thankful to PARA RAJESH, Department of CSE (CPDS) and who
has spared valuable time and append novel ideas to guide us in limelight. I am
indebted to them without whom I would not have culminated to pinnacle of the
project.

We express heartfelt gratitude to VIJAYA KUMAR VADLADI ,


Department of ECE (CPDS) for providing the necessary support for
documentation to complete this project successfully.

We are also thankful to the whole CPDS DEPARTMENT for their


encouragement and cooperation for the successful completion of the project.

JOHN PRANOY (15241A0257)

ATHISH CHOWDARY (15241A0254)

YENISETTY GOPAL (15241A0259)

Y KRUSHNA (15241A0258)

II
CONTENTS
 OVERVIEW OF C

 SYSTEM REQUIREMENTS

 PLAYING THE GAME. . . .

 CODING. . . .

 OUTPUT SCREENS. . .

 BIBILIOGRAPHY…

OVERVIEW OF C

III
C is a general-purpose, high-level language that was originally

developed by Dennis M. Ritchie to develop the UNIX operating system

at Bell Labs. C was originally first implemented on the DEC PDP-11

computer in 1972.

In 1978, Brian Kernighan and Dennis Ritchie produced the first

publicly available description of C, now known as the K&R standard.

The UNIX operating system, the C compiler, and essentially all UNIX

application programs have been written in C. C has now become a

widely used professional language for various reasons −

 Easy to learn

 Structured language

 It produces efficient programs

SYSTEM REQUIREMENTS
Hardware:
IV
Minimum Requirements:
One of the following processors:
Intel® Pentium® 4 processor family and higher
Intel(R) Xeon Phi(TM) coprocessor
Non Intel® processors compatible with the above processors

Software:
Minimum Requirements:
One of the following operating systems:
Microsoft* Windows* 8, 8.1
Microsoft* Windows* 7 SP1
Microsoft* Windows* Server 2012
Microsoft* Windows* Server 2008 SP2 (IA-32 only)
Microsoft* Windows* Server 2008 R2 SP1
Microsoft* Windows* HPC Server 2008
One of the following compilers:
Intel(R) C++ Compiler 13.1 (Intel(R) Parallel Studio XE 2013
SP1) and higher
Microsoft* Visual C++ 10.0 (Microsoft* Visual Studio* 2010,
Windows* OS only) and higher

V
Playing the Game
This game is simple and can be played by anyone. The computer
generates a random number between 0 and 50. We have 5
chances to find out the random number generated by the
computer. However, the computer tells us if the number is either
more than or less than the entered number. Good Luck!!!

VI
C SOURCE CODE
//guess d no

#include<stdio.h>

#include<conio.h>

#include<stdlib.h>

void main()

int count=5,n,ch,index=0;

char select;

clrscr();

randomize();

do

count=5;

textcolor(MAGENTA);

cprintf("--------------- GUESS THE NUMBER ----------------");

textattr(LIGHTRED);

cpri*ntf("\nThe no is b/w 0 and 50, gud luck!!");

printf("\n");

VII
n=random(50);

while(count!=0)

index=0;

textattr(YELLOW);

cprintf("Guess d number, only ");

textcolor(GREEN);

printf("%d",count);

textcolor(LIGHTBLUE);

cprintf(" chances left ");

scanf("%d",&ch);

if(ch==n)

cprintf("\nCORRECT xD");

index=1;

break;

else if(ch>n)

cprintf("\nIts less than tat\n ");

else

cprintf("\nIts more than tat\n ");

count--;
VIII
}

if(index==0)

cprintf("\nthe no is: %d",n);

cprintf("\ndo u want to play agn (y/n)");

cscanf("%c",&select);

clrscr();

while(select=='y'||select=='Y');

getch();

IX
SCREEN SHOTS

X
XI
BIBILIOGRAPHY
 http://www.google.com/

 http://en.wikipedia.org

 Computer Science with C++ by Sumita Arora

 Object Oriented Programming by Robert Lafore

 www.bOtskOOL.com

XII

Anda mungkin juga menyukai