Seriously, me and my stupid logic can't get rid of that syntax thing... My friend once fixed it but it reappeared when I ran it at my PC -
#include<stdio.h>
-
#include<conio.h>
-
#include<stdlib.h>
-
#include<time.h>
-
-
void main()
-
{
-
srand(time(NULL));
-
clrscr();
-
int you, comp;
-
randomize();comp=rand()%3+1;
-
printf("Jank'n Poy");
-
printf("\n[0]Scissor\n[1]Paper\n[2]Rock");
-
printf("\nEnter Your choice:");
-
scanf("%d",&you);
-
if((you==0)&&(comp==1))
-
{printf("Your Choice: Scissor");
-
printf("\nOpponent: Paper");
-
printf("\nYou Win!");}
-
else if((you==1)&&(comp==1))
-
{printf("Your Choice: Scossor");
-
printf("\nOpponent: Scissor");
-
printf("\n\nDraw!");}
-
else if((you==2)&&(comp==1))
-
{printf("Your Choice: Rock");
-
printf("\nOpponent: Paper");
-
printf("\n\nYou Lose!");}
-
else if((you==0)&&(comp==0))
-
{printf("Your Choice: Paper");
-
printf("\nOpponent: Paper");
-
printf("\n\nDraw!");}
-
else if((you==1)&&(comp==0))
-
{printf("Your Choice: Paper");
-
printf("\nOpponent: Scissor");
-
printf("\n\nYou Lose!");}
-
else if((you==2)&&(comp==0))
-
{printf("Your Choice: Rock");
-
printf("\nOpponent: Scissor");
-
printf("\n\nYou Win!");}
-
else if((you==0)&&(comp==2))
-
{printf("Your Choice: Scissor");
-
printf("\nOpponent: Rock");
-
printf("\n\nYou Lose!");}
-
else if((you==1)&&(comp==2))
-
{printf("Your Choice: Paper");
-
printf("\nOpponent: Rock");
-
printf("\n\nYou Win!");}
-
else if((you==2)&&(comp==2))
-
{printf("Your Choice: Rock");
-
printf("\nOpponent: Rock");
-
printf("\n\nDraw!");}
-
else if(you>3)
-
{printf("Invalid Input!");}
-
-
getch();
-
}
-
-
#include<stdio.h>
-
#include<conio.h>
-
#include<stdlib.h>
-
#include<time.h>
-
void main()
-
{
-
clrscr();
-
int a, b, c, d, e,result;
-
printf("Color Game");
-
printf("\n[1] Yellow \n[2] Blue \n[3] Viloet \n[4] Red \n[5] Green \n[6] Orange");
-
printf("\n\nBet:");
-
scanf("%d",&a);
-
printf("Your Color:");
-
scanf("%d",b);
-
c=1+random(6);
-
d=1+random(6);
-
e=1+random(6);
-
printf("\nColors:\t%d\t\t%d\t\t%d",c,d,e);
-
if((b==c)&&(b==d)&&(b==e))
-
{result=a*5;
-
printf("\n\n\t\tPrize:%d",result);}
-
else if(!(b==c)&&(b==d)&&(b==e))
-
{result=a*3;
-
printf("\n\n\t\tPrize:%d",result);}
-
else if((b==c)&&!(b==d)&&(b==e))
-
{result=a*3;
-
printf("\n\n\t\tPrize:%d",result);}
-
else if((b==c)&&(b==d)&&!(b==e))
-
{result=a*3;
-
printf("\n\n\t\tPrize:%d",result);}
-
else if(!(b==c)&&!(b==d)&&(b==e))
-
{result=a*2;
-
printf("\n\n\t\tPrize:%d",result);}
-
else if((b==c)&&!(b==d)&&!(b==e))
-
{result=a*2;
-
printf("\n\n\t\tPrize:%d",result);}
-
else if(!(b==c)&&(b==d)&&!(b==e))
-
{result=a*2;
-
printf("\n\n\t\tPrize:%d",result);}
-
else if(!(b==c)&&!(b==d)&&!(b==e))
-
{printf("\n\n\t\tSorry, You Lose!");}
-
getch();
-
}
-
3 1774
It's probably right here:
The time function returns a time_t but the srand function needs an unsigned int as an argument.
I expect after you cnvert a time_t to an unsigned int, your code will compile.
Uhmn.. so, what statement should I add or remove to make that error disappear?
- srand((unsigned)time(NULL));
-
printf("Your Color:");
-
scanf("%d",b); <-- &b
-
you'll want to fix this one -
#include<conio.h> non-standard header
-
-
randomize() non-standard function, I think
-
clrscr() non-standard function
-
the code bits above may cause problems depending on the compiler you're using.
post the compiler warnings / errors
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Sylwia |
last post by:
Hi!
I need your help...
I have the following problem. I've implemented the python Windows
Service which behaves like a log supervisor. If the space
used by log files is bigger than a given...
|
by: Larry Bates |
last post by:
It doesn't happen often, but once in a while I will
introduce a syntax error into a Python program I'm
working on (in IDLE) and doing File-Check responds
with the expected "Failed to check, syntax...
|
by: James |
last post by:
Please help me with this sql:
SELECT z005aNORTHEAST_3days_Formula.Region,
z005aNORTHEAST_3days_Formula.DiffofClaimsAssignment
FROM (SELECT .Region, (.)-(
.) AS DiffofClaimsAssignment
FROM...
|
by: nick |
last post by:
the following is my programming code and compile message
why the warning message arise, have i done somethings wrong?
#include<stdio.h>
typedef struct card{
int abc;
}card;
|
by: Eric |
last post by:
Hi
For this code,
int getopt (int argc, char *const argv, const char *opts)
what does the "char *const argv" mean? Does it equal to "char **const
argv"?
Or "char *const *argv"? Which is the...
| |
by: mirandacascade |
last post by:
I am prompted to make these inquiries after seeing the following link
to ctypes:
http://docs.python.org/lib/module-ctypes.html
in which ctypes is described as a foreign function library.
...
|
by: BobPaul |
last post by:
I'm following code out of a howto book and this is really bugging me. This header file was created by VStudio 6.0 when I did a "Right Click: Add Member Function" CLine is a class I wrote (per the...
|
by: Aries Sun |
last post by:
I am reading the book "Effective C++" Item 25 mentioned the following
code:
// a first cut at a class yielding NULL pointer objects
class NullClass {
public:
template<class T ...
|
by: blackdogharry |
last post by:
Hi,
I am a novice VBA user.
My access version is 2007 on Windows XP PC.
I need to create a query that will take pre-existing text values of the B_status field (such as "Received_Emailed",...
|
by: lingjun |
last post by:
Hi,
I am taking my first programing course in college... and I am completely lost on this assignment. I am not sure what is wrong with my current code. Any help will be appreciate it... thanks!
...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |