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
postnew [5]
3 years ago
5

A U.S. social security number consists of a string of 9 digits, such as "444422333". Declare a char array named ssn suitable for

storing a social security number as a C-string, and write a statement that reads in the next 9 characters of standard input into this array. (Assume that the input consists of one big sequence of digits without spaces or newlines.)
Computers and Technology
1 answer:
tatuchka [14]3 years ago
8 0

Answer:

Since the question expect us to declare a C-string, the solution code is written in C as follows:

  1.    char ssn[9];
  2.    scanf("%s",ssn);

Explanation:

A C-String is a string written in C language. It is an array of characters. To declare a C-string, we use the keyword, <em>char </em>and then followed with the variable name + brackets and the number of characters in the string. For example, we can create a C-String for the SSN number as in Line 1.

To read standard input into the array, we can use C built-in function, <em>scanf(). </em>Just include a string placeholder, %s, and the variable<em> ssn </em>as arguments to <em>scanf()</em>. This will assign the string input by user to variable <em>ssn</em> as C-String.

You might be interested in
Which of these are examples of a bug?
nadya68 [22]
The answer is b and c
7 0
3 years ago
Suppose that the host with IP address 10.0.1.19 sends an IP datagram destined to host 128.119.160.183. The source port is 3324,
Slav-nsk [51]

Answer:

The source and destination IP addresses are 10.0.1.19 and 10.0.1.25

Explanation:

NAT or network address translation is a network protocol is used by private networks to access the internet by assigning or mapping a public IP address to the private addresses.

The host with IP address 10.0.1.19 searches for the actual destination IP address 128.119.160.183 in its private network and when it does not find it, it sends the packet to the default gateway IP address 10.0.1.25, which is where the private IP address is NATted and sent to the destination.

5 0
3 years ago
Discuss the major differences in two approaches ofprogramming i.e. Object oriented programming and structuredprogramming.
Romashka-Z-Leto [24]

Answer:

Differences between Object Oriented Programming and Structured Programming

1. Structured programming focuses on process/logic then data while OOP(Object Oriented programming) focuses on data.

2.OOP supports Inheritance,Encapsulation,Abstraction,Polymorphism while structured programming does not supports these.

3.Structured programming follows top-down approach while OOP follows bottom-up approach.

4.OOP is more secured than structured programming because it supports Abstraction (data hiding).

7 0
3 years ago
Why people like adventures <br><br>​
OLEGan [10]

A lot of people do love going on different kinds of adventures. People do  like adventures because;

  • It helps to improve their physical health and it also hinders/ treat different scope or range of health issues.

  • It helps to make the human brain bigger that is, adventures such as hiking or walking helps to grow the brains.

  • People go on adventures so as to build or raise their tolerance level such as Tolerance for uncertainty.

  • Adventures helps to improve one's reflectiveness and mental skill
  • It gives you new ideas, feeds your dreams and also helps to builds your confidence.

Adventure is simply defined as the act of been involved in an unusual or exciting experience or any activity. It can be hazardous in nature.

Learn more about adventure from

brainly.com/question/25950911

3 0
2 years ago
Write a program with class name Digits that prompts the user to input a positive integer and then outputs the number reversed an
mr Goodwill [35]

Answer:

Written in Python:

inputnum = int(input("User Input: "))

outputnum = 0

total = 0

while(inputnum>0):

     remainder = inputnum % 10

     outputnum = (outputnum * 10) + remainder

     inputnum = inputnum//10

     total = total + remainder

print("Reverse: "+str(outputnum))

print("Total: "+str(total))

Explanation:

This prompts user for input

inputnum = int(input("User Input: "))

This initializes the reverse number to 0

outputnum = 0

This initializes total to 0; i.e. sum of each digit

total = 0

The following iteration gets the reverse of user input

<em>while(inputnum>0): </em>

<em>      remainder = inputnum % 10 </em>

<em>      outputnum = (outputnum * 10) + remainder </em>

<em>      inputnum = inputnum//10 </em>

<em>      This adds each digit of user input</em>

<em>      total = total + remainder </em>

This prints the reversed number

print("Reverse: "+str(outputnum))

This prints the sum of each digit

print("Total: "+str(total))

7 0
3 years ago
Other questions:
  • George borrowed some equipment from his friend for recording his monologue for his art class. He got all the equipment except th
    15·1 answer
  • A network administrator is implementing dhcpv6 for the company. the administrator configures a router to send ra messages with m
    6·1 answer
  • Please answer quick:))))
    7·1 answer
  • Given that arrayIntValues [MAX_ROWS][MAX_COLUMNS] is a 2 dimensional array of positive integers, write a C++ function Even to fi
    15·1 answer
  • 0001 0000 1100 0011 (unsigned, that is, interpreted as b2u)i.8 bit truncated value:ii.does the value change when truncated to 8
    7·1 answer
  • What makes these Pokémon special?
    9·2 answers
  • Mô tả những lợi ích của việc sử dụng đa xử lý không đồng nhất trong một hệ thống di động
    8·1 answer
  • What is your impression on the subject fundamentals of database systems?​
    7·1 answer
  • I need some help-
    15·1 answer
  • Which website offers guidance on putting together a checklist to provide guidance on configuring and hardening operating systems
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!