1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zlopas [31]
2 years ago
12

Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to

print two random integers between (and including) 0 and 9. End with a newline. Ex:
5.
7.
Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, after calling srand() once, do not call srand() again. (Notes)
1 #include
2 #include //
3 Enables use of rand ()
4 int main(void) ( int seedval;
6.
7. scanf ("%d", &seedval);
8.
9.
10 srand(int seedval);
11 printf("%d\n", srand());
12 printf("%d\n", srand());
13
14 return e;
15 }
Computers and Technology
1 answer:
Alik [6]2 years ago
8 0

Answer:

#include<stdio.h>

#include<stdlib.h>

int main(void){

int seedval;

scanf ("%d", &seedval);

srand(seedval);

printf("%d\n", rand()%10);

printf("%d\n", rand()%10);

 return 0;

}

Explanation:

The given code is poorly formatted. So, I picked what is usable from the code to write the following lines of code:

#include<stdio.h>

#include<stdlib.h>

int main(void){

This line declares seedval as integer

int seedval;

This line gets user input for seedval

scanf ("%d", &seedval);

This line calls the srand function to generate random numbers

srand(seedval);

This prints a random number between 0 and 9

printf("%d\n", rand()%10);

This also prints a random number between 0 and 9

printf("%d\n", rand()%10);

 return 0;

}

You might be interested in
What usually happens at a police check? Do they just look up your name in their system?
sdas [7]

it depends on the kind of police check. like if its a road block type of check, they make sure everything is right. if you get pulled over you get your name ran in the system to check if you have warrents or warning and depends on what you get pulled over for, you could get a ticket or detained.

5 0
3 years ago
How do you draw first angle of orthographic projection ​
attashe74 [19]
Https://technologystudent.com/designpro/ortho1.htm
5 0
2 years ago
In a penetration test, the ________ team comprises testers who are given no knowledge of the infrastructure and are attacking a
just olya [345]

Answer:

TIGER TEAM

Explanation:

Penetration testing is the act of simulating an attack on an organization's resources to assess an infrastructure's true vulnerabilities. A penetration test simulates an actual attack. Penetration testers use a variety of methods including social engineering, software hacking and physical intrusion.

There are different types of penetration testing teams which are: red team, blue team and purple team.

Red team also known as the tiger team simulates real types of cyber attacks in order to discover any unknown security vulnerabilities or weaknesses.

In penetration testing, tiger (red) team are the attackers and are usually outside contractors, with a lot of knowledge of how to break in but NO KNOWLEDGE OF WHAT SECURITY IS IN PLACE.

Therefore, In a penetration test, the TIGER TEAM comprises testers who are given no knowledge of the infrastructure and are attacking a target that is unaware of their existence until the attack is made.

3 0
3 years ago
Write an algorithm to print the minimum and maximum of an integer array. Your need to pass the array as a parameter. Since we ca
sammy [17]

Answer:

See explaination

Explanation:

MinMax.java

import java.util.*;

public class MinMax

{

static void MinMax(int[] arr)

{

int Min=arr[0]; // initializinf min and max with 1st value of array

int Max=arr[0];

for(int i=0;i<arr.length;i++) // iterating loop only once

{

if(arr[i]>Max) // checking max value

{

Max=arr[i];

}

if(arr[i]<Min) // checking min value

{

Min=arr[i];

}

}

System.out.println("Min Number is "+Min); //printing min value

System.out.println("Max Number is "+Max); //printing max value

}

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

System.out.print("Enter N value: "); // taking n value

int n=sc.nextInt();

int[] arr=new int[n];

System.out.println("Enter N elements:"); // taking n elements into array

for(int i=0;i<n;i++)

{

arr[i]=sc.nextInt(); // each element into the array

}

MinMax(arr); // calling MinMax() method.

}

}

4 0
3 years ago
Some of the items below indicate the steps required to move a slide to a different location in a presentation. Select those step
Ivan

Answer:

Following is the order of steps needed to move a slide to different location:

First: Select the slide

Second: Hold the slide button down

Third: Drag the slide to the desired place.

N/A : Enter the slide position desired.

N/A: Select Move from the Tools menu.

N/A: Switch to the Notes view.

I hope it will help you!

8 0
2 years ago
Other questions:
  • You notice that somehow you have duplicate records for some of your clients in your database. What should you do?
    13·2 answers
  • ………………….. is the process of causing a system variable to conform to some desired value. Options Control feedback Design none of
    9·1 answer
  • When should students practice netiquette in an online course?
    9·1 answer
  • It is not possible to use keywords to search for themes. true or false.
    9·1 answer
  • what is the purpose of the Outline view in word 2016? check all that apply. 1. editing the format of size and text. 2.working wi
    11·1 answer
  • Are you concerned that strangers may have access to the personal information you share on social media platforms? Why or why not
    10·1 answer
  • Discuss copyright issues as they relate to the Internet, including software piracy and digital rights management, and the Digita
    14·1 answer
  • 4.15 LAB: Password modifier
    14·1 answer
  • Whats the answer :)?<br>i will give brainslist​
    11·1 answer
  • what is the name of the program that enables the device and operating system to communicate with each other?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!