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

I want to solve this question in C program, Please.

Computers and Technology
1 answer:
inn [45]3 years ago
4 0

Answer:

#include <stdio.h>

#include <math.h>

int is_armstrong(int n) {

int cubedSum = 0;

int r = n;

while (r) {

         cubedSum += (int)pow(r % 10, 3);

          r = r / 10;

}

return cubedSum == n;

}

int stack_count(int n) {

int sum = 0;

while (n) {

         sum += n % 10;

         n = n / 10;

}

return sum;

}

int is_magical(int n) {

while (n > 9) {  

 n = stack_count(n);

 printf("%d ", n);

}

return n == 1;

}

int main()

{

int input = 0;

int isMagical, isArmstrong;

while (true) {

 printf("Enter a number: ");

 scanf_s("%d", &input, sizeof(int));

 if (input == -1) break;

 isArmstrong = is_armstrong(input);

 isMagical = is_magical(input);  

 if (isArmstrong && isMagical) {

  printf("%d is both an armstrong and a magical number.\n", input);

 } else if (isArmstrong) {

  printf("%d is an armstrong number\n", input);

 } else if (isMagical) {

  printf("%d is a magical number\n", input);

 } else {

  printf("%d is neither an armstrong or a magical number.\n", input);

 }

}

}

Explanation:

Here is a starting point. What's the definition of a magical number?

You might be interested in
Can someone else kill Raz and I can still get the challenge done by collecting the artifact in fort nite?
Margarita [4]
No Stop playing fort nite and play warzone
8 0
3 years ago
______ cards contain a chip that can store a large amount of information as well as on a magnetic. ______ cards contain a chip t
yuradex [85]

Answer:

A. Smart card

Explanation:

Smart cards contain a chip that can store a large amount of information as well as on a magnetic stripe for backward compatibility.

Smart card are cards made of plastic or metal material that has an embedded integrated chip that acts as a security token. Smart cards are the same size as a debit or credit card.

They connect to a reader either by a chip (microcontroller or an embedded memory chip) or through a short-range wireless connectivity standard such as radio-frequency identification or near-field communication.

It can be used to perform various functions though most commonly are used for credit cards and other payment cards.

3 0
3 years ago
From 1995 to 1997, the number of web users
BigorU [14]
Quadrupled. I think sorry if you get it wrong i do not remember much
7 0
3 years ago
Read 2 more answers
A method to move data through a network of links and switches which reserves communication sessions between end systems is calle
lubasha [3.4K]

Answer:Circuit switching and packet switching

Explanation: Circuit switching is the switching technique through the connection from the source port to the destination port.Packet switching is also a switching techniques in connectionless form for the data packets. Both these switching techniques helps in communication between end and start ports.

Other option are incorrect as the access networks provide the access to the network and throughput is the input passing in the network.Thus, the correct option is circuit switching and packet switching .

3 0
4 years ago
Data as a service began with the notion that data quality could happen in a centralized place, cleansing and enriching data and
saul85 [17]

Answer: True

Explanation:

 Yes, the given statement is true that the data as the service model basically describe about the data quality which could be happened in the centralized place and also enriching the given data. It also offer the data services to the different types of users, system and applications.

 The data as a service (DaaS) is similar to the software as s service. The DaaS concept is that it is provided according to the requirement of the user such as data and information of the different types of product and services.

 It is technically known as the web delivering service which is offer by the cloud manager and its also perform various types of function.  

7 0
3 years ago
Other questions:
  • Client/server networks are controlled by a central server that runs a specialized piece of software called
    8·1 answer
  • Describe the effect of a pull up resistor
    7·1 answer
  • (Please select 2)
    14·1 answer
  • HTTP is the protocol that governs communications between web servers and web clients (i.e. browsers). Part of the protocol inclu
    10·1 answer
  • Which of the following is false? Group of answer choices A) A string may include letters, digits, and various special characters
    7·1 answer
  • how write a program to prompt the user for hours and rate per hour using input to computer gross pay Use 35 hours and rate2.75 p
    9·1 answer
  • Which approach to knowledge management capitalizes on tacit knowledge and requires heavy IT investment?
    8·1 answer
  • Determining Uses for Outer Joins
    15·1 answer
  • How could you use your technology skill and Microsoft Excel to organize, analyze, and compare data to decide if a specific insur
    12·1 answer
  • Buying the newest phone as soon as it is released when your current phone works perfectly is not a good idea for all but which o
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!