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]
2 years ago
7

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

Computers and Technology
1 answer:
inn [45]2 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
Briefly explain specialisation?​
Jlenok [28]

Answer:

b

Explanation:

4 0
3 years ago
You enter information by keying it into the??​
Greeley [361]

Answer:

password and username

Explanation:

3 0
2 years ago
Read 2 more answers
What is a stored​ procedure?
pshichka [43]

Answer:

The right answer is Letter B. It is an area of memory that is used for dynamic memory allocation.

Explanation:

<em>Because a store procedure is not a computer program,neither a computer software . It is a type of code or subroutine available to applications that access a relational database management system. Such procedures are stored in the database data dictionary. It serves to save time and memory, extensive  or complex processing that requires execution of several SQL. </em>

6 0
3 years ago
What do you think are the IPO components in an online movie ticket booking system?
zalisa [80]

Explanation:

Online Movie Ticket Booking System is a website to provide the customers facility to book tickets for a movie online and to gather information about the movies and theaters. Customer needs to register at the site to book tickets to the movie

Advantages of Online Booking Systems

Your business is open around the clock. ...

You can maximize reservations. ...

You get paid quicker. ...

You're not tied to a phone. ...

You can effortlessly up-sell add-ons. ...

It's easy to manage your calendar. ...

You get valuable insight about your business

4 0
3 years ago
What is the purpose of OPPA? A. It regulates the strength of passwords chosen by the users. B. It prohibits the use of informati
Anna35 [415]

The purpose of OPPA is to make its mandatory for companies to disclose what kind of information they will acquire from their users.

D. It makes it mandatory for companies to disclose what kind of information they will acquire from their users.

<u>Explanation:</u>

OPPA is a Online Privacy Protection Act. It gathers data from individuals who use or visit your site and use it to execute business with them. A few organizations use client data for their very own inner showcasing purposes, for example, to figure out what sort of items or administrations to offer whenever the client utilizes the site or to create focused on arrangements of clients who have similar likes or aversions.

It makes it obligatory for organizations to reveal what sort of data they will secure from their clients. It likewise incorporates data, for example, name, road address, email address, phone number, date of birth, Social Security number, or different insights concerning an individual that could enable a customer to be reached physically or on the web.

6 0
3 years ago
Other questions:
  • In addition to training on the products and on company policy, it does not make sense to be prepared to speak about your company
    6·2 answers
  • Rebooting the computer is a good troubleshooting technique.<br><br> True<br> False
    6·2 answers
  • In these weeks readings, we learned about the CIA Triad and how each exhibits dependence on the other. Give examples of how fail
    12·1 answer
  • Which are characteristics of an effective solution? Choose all that apply. solves the problem in anticipated ways each time resu
    5·1 answer
  • "Create a Matlab Scrapt that will take the a Matrix A and Matrix B (of AX=B), then calculate the Determinant of Matrix A, Invers
    5·1 answer
  • What do you call the spreadsheet cell that is in effect and has a heavier black border around it?
    7·2 answers
  • Caleb is a big fan of science fiction, so he loves picturing the ________ gland as the captain of his personal starship, pulling
    9·1 answer
  • Rhea has been asked to interview the new CEO of an energy company. She has scheduled a meeting with him in the company’s meeting
    9·2 answers
  • What are the challenges of Cyber Law???? Needed ASAP ​
    5·1 answer
  • Compare and contrast the advantages and disadvantages of a LAN to a WLAN.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!