online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> void main() { srand(time(NULL)); int r = rand(),v; char i; printf("Enter R for Rock, P for Paper, S for Scissor \n"); scanf("%c",&i); if(i == 'R' || i == 'r') { v = 1; } else if (i == 'S' || i == 's') { v = 2; } else if (i == 'P' || i == 'p') { v = 3; } else { printf("INVALID INPUT"); } if(r < 715827882) { r = 1; } else if (r >= 715827882 && r < 2*715827882) { r = 2; } else if (r >= 2*715827882 && r < 2147483649) { r = 3; } if(v == r) { printf("tie"); } else if (v == 1 && r == 2) { printf("Computer Wins ."); } else if (v == 1 && r == 3) { printf("you win"); } else if (v == 2 && r == 1) { printf("You Wins "); } else if (v == 2 && r == 3) { printf("Computer Wins "); } else if (v == 3 && r == 1) { printf("Computer Wins"); } else if (v == 3 && r == 2) { printf("You Win "); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue