programming language must be in BASIC
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int i,j,val,f=0,count=0,temp;
int min=1,max=6;
for(i=0;i<100;i++)
{
printf("\n\nThe dice is rolled %d times",i+1);
val=(rand() % (max - min + 1)) + min;
if(val!=1)
{
for(j=1;j<=val;j++)
{
if(val%j==0)
f++;
}
if(f==2)
{
printf("\nWe got a prime number: %d",val);
count++;
}
else
printf("\nWe didn't get a prime number this time");
}
else
printf("\nWe got %d which neither prime nor composite",val);
f=0;
val=0;
}
printf("\n\n---------->We got %d prime numbers<----------",count);
}
I have used C programming here, which is a high level programming language and it is a very BASIC language for the beginners
programming language must be in BASIC Write a program that finds how many times a prime...
I am having some trouble writing this program. In C language Write a program which asks user 1) number of sets (integer input), followed by 2) number of sides of a dice (integer input) and 3) number of dices (integer input). number of sets mean how many times this process is going to repeat, number of sides mean total number of sides in a dice (usually 6) and number of dices mean how many number of dices we’re going to...
CODE MUST BE WRITTEN IN SWIFT programming language Write a function that takes in two positive integers and prints every prime number between (and including) them Sample Input: prime(from: 0, to: 100) Sample Output: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
Using very basic Java programming Write a program that lets the user play the game of Rock, Paper, Scissors against the computer.The program should use an array of Strings with the names of the choices.The program should loop until the human player decides to quit.The game should keep track of how many times the human won, lost, or tied and present those values when the game ends.
21. An isolated prime is a prime number p such that neither p -2 nor p+2 is prime. For example, 47 is an isolated prime since 45 and 49 are both not primes. Write a computer program that finds all the isolated primes between 50 and 100. Do not use MATLAB's built-in function isprime. Matlab Instructions: Make in while and for, mode
21. An isolated prime is a prime number p such that neither p -2 nor p+2 is prime....
Write a program that will allow the user to specify how many times the program will loop and display the title of the program include your name in the title, print from in the loop a string and count. -Assembly Language MASM 8086
THE PROGRAMMING LANGUAGE IS C++ Part 1.Create a program that decides whether a given integer is prime or not. The program should at the end of its analysis print the number followed by prime or composite. Part 2.Make the program from part 1 print the prime factors of any composite number entered (an additional feature to Part 1). THE PROGRAMMING LANGUAGE IS C++
How do I write a C program that finds how many times a word is used in a string and prints the result. The string is hardcoded. How do I also make it print the hashes? For instance: String: " Dog Cat Owl Ferret Rabbit Cat Dolphin Penguin Cat" Word 1: Owl Word 2: Cat Desired Output: Owl- 1 time(s) Cat: 3 time(s) Owl- # Cat-###
ssembly Language Programming with x86, IRVINe MASM 1. Write a program to add 7 12 times and print out the result ------------------------------------------------------------------------------- Write a program to print and add 10 20 30 40 50 ; you can use a loop The output should be “The sum of 10 20 30 40 50 ”
Write a C program that prompts the user for the number for times the user wants to flip a coin. Your program will flip a virtual coin that number of times and return the following: 1) The number of times heads occurred. 2) The number of times tails occured. Then take the coin flip program and modify the random number generator to roll a single 6-sided dice. DO NOT DISPLAY THE RESULTS OF EACH ROLL. 1) Ask the user how...
. Write an 8086 assembly language program to find the prime numbers among 100 bytes of data in an array stored from the address 4000H: 1000H in the data segment and store the result from the address 4000H: 3000H. write the code using 8086 assembly language only i do not want any other language If you Do not sure please do not solve it