This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.util.Random; | |
public class NumberGame { | |
public static void main(String[] args) { | |
//Random Number Generation | |
Random rand = new Random(); | |
//Scanning input from user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
int x; | |
char myArray[7]; | |
void binPrint(); | |
main(){ | |
int y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
main(){ | |
int x,y, mask = 0x80; | |
char myArray[7]; | |
for(y=0;y<=3;y++){ | |
printf("Please enter a number: "); | |
scanf(" %d",&x); | |
if(x&mask){ | |
myArray[0]='1'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
#include <math.h> | |
main(){ | |
float const pi = 4.0 * atan(1.0); | |
float Z, Xc, Xl, R, f, deg, rad, L, C; | |
int cntr; | |
char Ckt; | |
for(cntr=0;cntr<5;cntr++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdio.h> | |
#include <conio.h> | |
main(){ | |
float cost; | |
int dist; | |
printf("Please enter a distance: "); | |
scanf(" %d",&dist); | |
if (dist<=100 && dist>0){ | |
cost = 5.00; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdio.h> | |
#include <conio.h> | |
main(){ | |
int opCode; | |
float x, y, sum; | |
printf("Please enter a value for x: "); | |
scanf("%f", &x); | |
printf("\nPlease enter a value for y: "); | |
scanf("%f", &y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
#include <math.h> | |
main(){ | |
float A, B, C, C2, p=2; | |
printf("Please enter a value for side A: "); | |
scanf("%f", &A); | |
printf("\nPlease enter a value for side B: "); | |
scanf("%f", &B); | |
C2 = (A*A + B*B); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
main(){ | |
int age; | |
printf("Please enter your age: "); | |
scanf("%d", &age); | |
printf("\nThe age you lied about is %d", age); | |
while( !kbhit()){} | |
} |