write a program to accept a name and roll number of 5 student using structure in C​

Answers

Answer 1

Answer:

This C program is to store and display the information of a student using structure i.e. to store and display the roll number,name,age and fees of a student using structure.

Basically one should know how to write the syntax of a structure and the rest is just implementation of the programs done so far.

If you yet need a dry run of the program or any other query, then kindly leave a comment in the comment box or mail me, I would be more than happy to help you.

Answer 2
CODE

#include <stdio.h>

#include <string.h>

struct student {

char name[50];

int roll;

};

int main() {

struct student student1;

strcpy(student1.name, "Chris Hansen");

student1.roll = 38;

printf("Name: %s\nRoll number: %d\n", student1.name, student1.roll);

struct student student2;

strcpy(student2.name, "Edip Yuksel");

student2.roll = 19;

printf("Name: %s\nRoll number: %d\n", student2.name, student2.roll);

struct student student3;

strcpy(student3.name, "Skeeter Jean");

student3.roll = 57;

printf("Name: %s\nRoll number: %d\n", student3.name, student3.roll);

struct student student4;

strcpy(student4.name, "Sinbad Badr");

student4.roll = 114;

printf("Name: %s\nRoll number: %d\n", student4.name, student4.roll);

struct student student5;

strcpy(student5.name, "Titus Alexius");

student5.roll = 76;

printf("Name: %s\nRoll number: %d\n", student5.name, student5.roll);

return 0;

}

DISPLAY

Name: Chris Hansen

Roll number: 38

Name: Edip Yuksel

Roll number: 19

Name: Skeeter Jean

Roll number: 57

Name: Sinbad Badr

Roll number: 114

Name: Titus Alexius

Roll number: 76

EXPLANATION

Use string.h to access string functions for names.

Create a struct outside of the main on student name and roll number.

strcpy works for strings.

Create for 1 student and copy and paste for the others.

Display the name and roll number for each student.


Related Questions

What is the purpose of creating folders in a file structure????
A. To store more than 256
location
B. To allow windows naming to be applied
C. To secure files
D. To store thousand organized way

Hurry I need help plzzzz!!!

Answers

Answer:

D

Explanation:

everything is about organised it's about how you store your things to find them faster when you need them

How do I retrieve the number from an old home phone? Someone called my home phone (it is not a cellular phone) and they did not leave their phone number. Any advice welcome.

Answers

Answer: Use recent Callers function

Explanation:

Now all home phones have different ways of getting there, but should you see a settings, or functions button, or even a button that looks out of place in the middle of the phone right underneath the screen, that is the button that you will select. Go through the options available and you will see a option called "Recent Callers" and there you will be able to find all the recent callers whom called your home phone.

Debug the code in the main method of this class, which is intended to initialize an array named arr to hold 3 ints, fill this with 3 inputs from the user, then print the contents of the array in order followed by the sum.
Here's the code that needs to be fixed:

import java.util.Scanner;

public class U6_L1_Activity_One{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int[] arr = new int(3);
arr[1] = scan.nextInt();
arr[2] = scan.nextInt();
arr[3] = scan.nextInt;
System.out.println("Contents: " + arr{1} + " " + arr{2} + " " + arr{3});
System.out.println("Sum: " + arr[1] + arr[2] + arr[3]);
}
}

Answers

Answer:

import java.util.Scanner;

public class U6_L1_Activity_One{

 public static void main(String[] args){

   Scanner scan = new Scanner(System.in);

   int[] arr = new int[4];

   arr[1] = scan.nextInt();

   arr[2] = scan.nextInt();

   arr[3] = scan.nextInt();

   System.out.println("Contents: " + arr[1] + " " + arr[2] + " " + arr[3]);

   int Sum = (1 + 2 + 3);

   System.out.println("Sum: " + Sum);

 }

}

Explanation:

Debugging a code involves locating and correcting the errors in the code.

The errors in the code are:

Invalid array declaration and indexingImproper usage of the scanner objectIncorrect syntax of sum

So, the corrected code segment is as follows:

        int [] arr = new int[3];

       arr[0] = scan.nextInt();

       arr[1] = scan.nextInt();

       arr[2] = scan.nextInt();

       System.out.println("Contents: " + arr[0] + " " + arr[1] + " " + arr[2]);

       System.out.println("Sum: " + (arr[0] + arr[1] + arr[2]));

Read more about debugging at:

https://brainly.com/question/18844825

Which tool adds different amazing effects to a picture.

(a) Paint

(b) Lines tool

(c) Magic tool​

Answers

Answer:

magic tool

Explanation:

What is the output of the code?
public class trackList
public static void main(StringD args)
ArrayList track new ArrayListcinteger)
track.add(45);
track.add(55);
track.add(85);
System.out.print(track);
runtime error
45
55
85
compiler error

Answers

Answer:

45, 55, and 85

Explanation:

The Java program is complete and logically correct. It creates and adds integer values to an array list. The 'System.out.print' function of the track array variable would not throw any error but output the list of integer values.

ChodeHS Exercise 4.3.5: Coin Flips

Write a program to simulate flipping 100 coins. Print out the result of every flip (either Heads or Tails).


At the end of the program, print out how many heads you flipped, how many tails you flipped, what percentage were heads, and what percentage were tails.

Answers

Answer:

public class CoinFlips extends ConsoleProgram

{

   public static final int FLIPS = 100;

   

   public void run()

   {

       int countH = 0;

       int countT = 0;

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

       {

           if (Randomizer.nextBoolean())

           {

               System.out.println("Heads");

               countH += 1;

           }

           else

           {

               System.out.println("Tails");

               countT += 1;

           }

       }

       System.out.println("Heads: " + countH);

       System.out.println("Tails: " + countT);

       System.out.println("% Heads: " + (double) countH / FLIPS);

       System.out.println("% Tails: " + (double) countT / FLIPS);

   }

}

Explanation:

First define your counting variables for both heads and tails (I named them countH and countT). Set them to 0 at the start of the run.

Then use a for loop to flip the coin 100 times. In the video you should have learned about the Randomizer class so you can use the same idea to print out whether you got heads or tails.

Make sure to keep the count going using >variable name< += 1.

The printing at the end is very basic; print the statement for each: ("Heads: " + >variable name<);

For the percentages, print ("% Heads: " + (double) >variable name< / FLIPS); divided by FLIPS (not 100 or any other int because you will get the wrong value) and remember to cast them as doubles to get the correct value.

The program simulates 100 coin flips and displays the result of each flip and the resulting percentage. The program written in python 3 goes thus :

import random

#import the random module

total = 0

#initialize the total coin flips

h_count = 0

t_count = 0

#initialize variable to hold the number of heads and tails

h_t = ['h', 't']

#define the sample space

while total < 100 :

#keeps track that tosses does not exceed 100

toss = random.sample(h_t, 1)

#variable to hold the outcome of each coin toss

if toss[0] == 'h':

#heck if toss is head

h_count+=1

Increase count of heads. owee

print(toss[0], end=' ')

#display the sample selected

else:

#if not head, then it's tail

t_count+=1

#increase count yv

print(toss[0], end=' ')

total+=1

#

print('head counts : ', h_count, 'percentage : ', round(h_count/100, 2),'%')

print('tail counts : ', t_count, 'percentage : ', round(t_count/100, 2), '%')

# display result.

A sample run of the program is attached

Learn more: https://brainly.com/question/18581972

It is important to know the terms of use of any website because why

Answers

They may be selling your information. For example have you ever seen a icon that said accept cookies.. that is a type of term you must agree on to enter certain websites.
They could sell your information or HAC you

Adam is so good at playing arcade games that he will win at every game he plays. One fine day as he was walking on the street, he discovers an arcade store that pays real cash for every game that the player wins - however, the store will only pay out once per game. The store has some games for which they will pay winners, and each game has its own completion time and payout rate. Thrilled at the prospect of earning money for his talent, Adam walked into the store only to realize that the store closes in 2 hours (exactly 120 minutes). Knowing that he cannot play all the games in that time, he decides to pick the games that maximize his earnings

Answers

Answer:

line = sys.stdin.readline()

print(line)

Explanation:

The first line of input is always an integer denoting many lines to read after the first line. In our sample test case, we have 6 in the first line and 6 lines after the first line, each having a game, completion_time and payout_rate.

In each data line, the game, completion_time and payout_rate are separated by a ','(comma).

The games board may change but the store still closes in 120 minutes.

Input

6

Pac-man,80,400

Mortal Kombat,10,30

Super Tetris,25,100

Pump it Up,10,40

Street Fighter II,90,450

Speed Racer,10,40

Output Explanation

Print the game names that earn him the most into the standard output in alphabetical order

Output

Mortal Kombat

Pump it Up

Speed Racer

Street Fighter II

Python:

import sys

line = sys.stdin.readline()

print(line)

Which of the following is true of operations within a spreadsheet program’s built-in functions?
Operations within parentheses, then multiplication and division, and then addition and subtraction are computed.
Operations within parentheses, then addition and subtraction, and then multiplication and division are computed.
Multiplication and division, then addition and subtraction, and then operations within parentheses are computed.
Addition and subtraction, then multiplication and division, and then operations within parentheses are computed

A. Operations within parentheses, then multiplication and division, and then addition and subtraction are computed.

Answers

Answer:

a is the answer

Explanation:

Advanced Search forms make it easier for you to _____. Select all that apply. A. find webpages published within a certain time frame B. search a specific website C. search your computer D. find webpages written in a specific language

Answers

Answer:

The correct answers are A, B and D. Advanced Search forms make it easier for you to find webpages published within a certain time frame, search a specific website and find webpages written in a specific language.

Explanation:

Advanced Search is called the specific search filters that the different internet search engines have, such as Goo.gle or Yah.oo, by means of which parameters can be established within which the search engine will collect information in a more precise way for the user. Thus, the user selects temporal, territorial, idiomatic parameters, etc., on which to focus their search, obtaining more specific results than those that a generic search would yield.

Advanced search forms make it easier to find webpages published within a certain time frame, search a specific website, and find webpages written in a specific language (Options A, B and D).

Advanced search forms enable the generation of search queries by employing specific content fields and/or segments.

The advanced search forms are useful to search any type of specific information in an easy user-friendly manner.

This type of search (advanced search) can be used to customize and filter search results in a dynamic manner, including a given period of time, different languages, etc.

In conclusion, advanced search forms make it easier to find webpages published within a certain time frame, search a specific website, and find webpages written in a specific language (Options A, B and D).

Learn more in:

https://brainly.com/question/3198358

Sonja is writing a program to compare two numbers and print the larger number. Which of these should be used?
a while loop
if and else
if, elif, and else
a string variable

Answers

Answer:

if and else

Explanation:

if (num1 > num2):

   print(num1)

else:

   print(num2)

5. Describe the concept behind a digital signature and explain how it relates to cybersecurity by providing a hypothetical example of a situation in which a digital signature could enhance cybersecurity

Answers

Answer:

Could help when two doctors have to approve a patients treatment, or when two workers of the same company are working on classified information.

Explanation:

A digital signature creates a stamp on a document, that has time, location and is used to assure that the right person was the one that signed off the document and that no one changed the message or the content of the document between the signer and the receiver.

This helps in providing security and a legal frame to digital documents.

Chief technology officers can influence a company's current and future ____.

Answers

Answer: developments is my best guess

Explanation:

What is the value in y2 when the code show below executes?
x1 = [ 5 3 1 7 9]; [y1 y2] = min(x1)

Answers

Answer:

y2 = 3

Explanation:

This question needs us to give the value of y2 when we run this code in the question.

By min(X1) it is asking for the minimum value in the list of values that we have in the question.

Y1 is the first minimum value in the list and it is = 1

Our answer of interest in this solution is to, which is the second minimum value in the list after Y1

Therefore y2 = 3

Thank you!

Which line of code will display the variable rounded to the nearest tenth?
print(num, round)
print(round(num, 1))
print(num rounded)
print(round(num,.1))

Answers

Answer:

print(round(num, 1))

Answer:

D

Explanation:

1) If a robot has a 3 bit instruction set and needs 20 instructions to reach its destination, how many bits of memory are required?


2) A robot driven by a raspberry Pi has 256MB of memory. The robot has a 3 bit instruction set. What is the maximum number of instructions that can be loaded into the robot?

3) Imagine that the robot with 256MB of memory needs 500,000 4-bit instructions to perform a job. Would it be possible to load in all the 500,000 instructions into the memory of the robot?

Answers

Answer:

Explanat500,000ion:

The Publisher-Subscriber design pattern is used to create __________________ communication between software objects and is used to build _____________ components.

Answers

Answer:

indirect, reusable

Explanation:

The Publisher-Subscriber design pattern is used to create indirect communication between software objects and is used to build reusable components.

What do presentations in spreadsheet software have in common??

A. Both analyze numeric data
B. Both calculate numeric formulas
C. Both convey numeric and/or text data
D. Both illustrate 


Hurry plzzz first person gets brainiest

Answers

Answer:

C both convey numeric and text data.

Explanation:

It's the most likely answer.

C) hope this helps out

I get brainlist to whoever can help my computer is doing this and I have class and it’s not working and I got it wet yesterday but it was fine in homeroom help please

Answers

Answer:

try putting a lot of rice on the screen.

Explanation:

if it got water in it that should help it.

did u try rice? how about turning it off and back on again?

For which of the seven steps to solve a programming problem is the scientific method most useful?

Answers

Answer:

the planning stage

Explanation:

The scientific method would be most useful during the planning stage of solving a programming problem. This is because during this stage you are thinking of what the problem is and what are the possible solutions that may work. The scientific method is made to help scientists do just that, understand what the problem is, design a possible solution from a hypothesis and design a way to implement or test that solution. Which is the most important piece of solving a programming problem (designing a solution)

When is historical data not useful

Answers

Answer:

to address for setting cost increase of a resource to determine the amount of money needed for a future project to plan for future years operation costs to predict sales based on past growth

1. What is the primary tool that Windows Server administrators use to create and manage user accounts

Answers

Answer to you questions is: Active Directory

pls help ...
Consider the code given below:
public class Testone {
public static void main (String[] args) throws Exception {
Thread.sleep (3000);
System.out.println("sleep");
}
)
What is the result?
Select one:
a. The code executes normally and prints "sleep".
b. The code executes normally, but nothing is printed.
a
C. A RuntimeException is thrown at runtime
d. Compilation fails
e. An exception is thrown at runtime.
Next pag​

Answers

Answer:

You open the class, and print sleep after thread 3000So A

A message with 3000 bytes gets encoded using the scheme Base64. What will be the size of the encoded message?

Answers

Answer:

4000 characters

Explanation:

Base64 encodes each set of three bytes into four bytes.

So 3000 * 4/3 = 4000 characters.

Name and define two ways an IDS connects to a network.

Answers

Answer:

The two ways an IDS connects to a network are:

1. Signature-based detection uses patterns by establishing a unique identifier for the detection of future cyber attacks, using the IDS sensors and consoles.

2. Statistical anomaly-based detection, as an expert system, relies on the identification of anomalies in the network traffic by comparing against established baselines.

Explanation:

Organizations use the Intrusion Detection System (IDS) as a software program to detect a computer network attack in an effort to stop the attack.  The program analyzes the network traffic for signatures of known cyberattacks and the delivery of network packets.  There are two types: NIDS and HIDS.  Whereas a Network Intrusion Detection System (NIDS) is designed to support multiple hosts, a Host Intrusion Detection System (HIDS) is set up to detect illegal cyber actions in a host's operating system files.


Victor has an Excel workbook that contains a macro. What is the appropriate file type to save the workbook in?
xlsx
xitx
xlsm
xlx

Answers

Answer:

xlsm

Explanation:

Generally, workbooks are known as Microsoft Excel files. Excel workbook can be defined as a collection of one or more charts and worksheets (spreadsheets) used for data entry and storage in an excel file. In order to create a project on Excel you will have to use a workbook.

A spreadsheet can be defined as a file or document which comprises of cells in a tabulated format (rows and columns) typically used for formatting, arranging, analyzing, storing, calculating and sorting data on computer software applications such as Microsoft Excel.

The Microsoft developers has made it easy for their users to automate the tasks used frequently through the creation and execution of macros.

Basically, macros comprises of commands and instructions which may be grouped together as a single command to automatically execute a task.

In this scenario, Victor has an Excel workbook that contains a macro. Thus, the appropriate file type to save the workbook in is the xlsm extension (format).

An algorithm is Group of answer choices The part of the computer that does the processing A complete computer program The inputs and outputs of a program A finite set of steps to solve a problem

Answers

Answer:

A finite set of steps to solve a problem

Explanation:

From the list of given options, option D describes an algorithm

Other options such as:

(A) describes the CPU of a computer;

(B) describes a written program which is achieved with the use of one or more programming languages

and (C) which describes the data that is being supplied into the program and also the information expected from the program.

Hence:

(D) is correct

Docker is focused on ______ containerization.

Answers

Answer:

Application

Explanation:

Docker is a known container technology platform that can help in the packaging of an application by a developer. It is a platform that is used by software developers to build applications based on containers. Using this containerization platform would enable the application to run without issues In any environment. That is either development, test or production environment.

What are some of the issues that create conflict in the future and why?

Answers

Answer:

Some of the reasons for future conflict between nations could be:

Explanation:

1: water wars, this is something possibly brewing between Ethiopia and Egypt with Sudan being on Ethiopia's side as the dam Ethiopia plans to build which would take a lot of Egypt's water would also power Sudan with electricity. Oh and something frightening could happen as China is damming India's major rivers which could lead to a world war or India becoming a Chinese vassal and massive amounts of displaced and starving people either way.

2: a global economic drop: this will severely impact the economies of many countries, especially countries in the middle of industrialization in Africa which are very fragile, I will give it a few decades to fully blow up there.

3:Competing interests, ethnic and international for example in Central Asia there are a lot of competing influences and something could happen there but thing is wars because of what I just mentioned are already happening, look at Syria with the "moderate" rebels, between Armenia and Azerbaijan we have had a conflict which had several geopolitical implications and reasons it went as it did, currently Libya is in a proxy war too, and recently Ethiopia has had conflicts within a Northern region which are heavily ethnic-based and could lead to an Ethiopian civil war if the government does not manage to solve this, which would also mean the first war I mentioned would be delayed or prevented trough another bloody war.

4: an incident: many wars have started because of incidents escalating, so watch out for it, for example earlier this yea- oh it's been a year already since Qasem Soleimani was assasinated , however luckily nothing happened then.

Either way we're gonna have more wars before world peace and mercenaries are becoming more popular like Turkey and more countries are using in proxy wars and another thing you should watch out for is the first use of robots in war and hope that they distinguish between regular humans and soldiers and don't commit atrocities, happy 2021!


1. Avoid unnecessary sliding of T-square or triangles across the drawing

Answers

Answer:

The answer is "True".

Explanation:

It is vertical or ambiguous districts are called a triangle. It typically comes in different sizes but is made of photographic film or plastic. Its triangles more widely shown are 45 grades and 30 grades were x 60. The following illustrations illustrate their correct use of T-square or triangle graph lines. The T-Place a designing tool, which is used to draw horizontal and vertical lines.

Other Questions
What are three contributions of Ancient Egypt At 9 a.m., a freight train leaves Boston for NY C, traveling at an average rate of 24miles per hour. At noon, a passenger train sets out on the same route, traveling at anaverage rate of 60 miles per hour. How far from Boston do the two trains pass eachother? Find the perimeter of the figure below. waht is x-500=7 is x equals to 240 a new energy drink advertise 182 calories for 6 ounces how many calories are in 21 ounces of the drink? There are ____ calories in the 21 ounce drink v*2 = u*2+ 2asy = 35.2 correct to 1 decimal placea = 9.8 correct to 1 decimal places = 60.35 correct to 2 decimal placesWork out the upper bound for u.Give your answer to 3 significant figures. 2731321=167 6 Solve the inequality and graph the solution on the line provided.-7x + 8< -6 Please help! I am so confused on this, I've probably been stuck on it for at least an hour. -4y+6=-3y+12 help pls someone help me please and thank you "Because she wore a yellow dress."What kind of error is in this sentence?1. run-on sentence2 no verb 3. no subject-verb agreement 4. sentence fragmentis this English- it says language for me Two triangles are similar. The smaller triangle has side lengths 10, 20, and 15 units. The larger triangle's longest side is 52 units. What is the perimeter of the larger triangle? How can your outline help you if you get stuck while drafting?O A. Your outline automatically diagnoses your problem.B. Your outline provides new ideas,O c. Your outline revises your draft.D. Your outline lets you review your original ideas. whatare thepurpose of communication ? Nadia thinks of a number.She finds the square root and then divides by 5.Her answer is 20.What number is she thinking of? The solar system is part of the Milky Way Galaxy. How is that galaxypart of a larger system? what amendments expand and protect civil rights a. 1. In two well crafted paragraphs (6-8 sentences each) introduce me to Socrates. Make sure the 5 Ws (the 411) are addressed. 2. Choose one quote by Socrates you find meaningful and powerful and explain what it means to you and why you selected it. 1. What is the sum of the measures of the interior angles of a 27-gon? (1 point)