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
Olin [163]
3 years ago
14

rocess inputs using the following 1) Write a function that inputs numerical digits in the range of an unsigned short. 2) Write a

function that reverses the number to a range of a signed short. 3) Only subtract the largest 3 digit number from the reverse if the result is not negative.
Computers and Technology
1 answer:
yawa3891 [41]3 years ago
4 0

Answer:

 /* sizeof.c—Program to tell the size of the C variable */

 /*      type in bytes */

 

 #include <stdio.h>

 

   int main(void)

  {

  printf( "\nA char   is %d bytes", sizeof( char ));

  printf( "\nAn int   is %d bytes", sizeof( int ));

  printf( "\nA short   is %d bytes", sizeof( short ));

  printf( "\nA long   is %d bytes", sizeof( long ));

  printf( "\nA long long is %d bytes\n", sizeof( long long));

  printf( "\nAn unsigned char is %d bytes", sizeof( unsigned char ));

  printf( "\nAn unsigned int  is %d bytes", sizeof( unsigned int ));

  printf( "\nAn unsigned short is %d bytes", sizeof( unsigned short ));

  printf( "\nAn unsigned long is %d bytes", sizeof( unsigned long ));

  printf( "\nAn unsigned long long is %d bytes\n",

   sizeof( unsigned long long));

 printf( "\nA float   is %d bytes", sizeof( float ));

 printf( "\nA double  is %d bytes\n", sizeof( double ));

 printf( "\nA long double is %d bytes\n", sizeof( long double ));

return 0;

 }

2. #include<stdio.h>

int main(){

  int num,reverse_number;

  //User would input the number

  printf("\nEnter any number:");

  scanf("%d",&num);

  //Calling user defined function to perform reverse

  reverse_number=reverse_function(num);

  printf("\nAfter reverse the no is :%d",reverse_number);

  return 0;

}

int sum=0,rem;

reverse_function(int num){

  if(num){

     rem=num%10;

     sum=sum*10+rem;

     reverse_function(num/10);

  }

  else

     return sum;

  return sum;

}

3.  

#include <bits/stdc++.h>  

 

using namespace std;  

/* Iterative function to reverse digits of num*/

int reversDigits(int num)  

{  

   int rev_num = 0;  

   while(num > 0)  

   {  

       rev_num = rev_num*10 + num%10;  

       num = num/10;  

   }  

   return rev_num;  

}  

 

/*Driver program to test reversDigits*/

int main()  

{  

   int num = 4562;  

   cout << "Reverse of no. is "

        << reversDigits(num);  

   getchar();  

   return 0;

You might be interested in
What is the only language a microprocessor can process directly but most programmers almost never write programs in this code?
Phantasy [73]
Assembly language, a.k.a. machine language.
6 0
3 years ago
What should be the very last function performed in the lab before you leave? Bid the instructor farewell wipe your hands on a to
34kurt

Answer:

Wash your hands with soap and water.

Explanation:

This answer comes with common sense, because before you leave, you MUST wash your hands, it's hygiene measure.

7 0
3 years ago
When you copy text, the selected text is copied from the original location and placed on the
Katyanochek1 [597]

Answer:

Clipboard

Explanation:

When you copy text, the selected text is copied from the original location and is placed in the clipboard. The clipboard is a temporary storage place in the computer’s memory. You can use the clipboard by cutting or copying a selected text.

7 0
3 years ago
Write a while loop that lets the user enter a number. The number should be multiplied by 10, and the result assigned to a variab
pentagon [3]

Answer:

#include <stdio.h> // header file inclusion

int main() // main function declaration

{

    int number,product=0; // variable declaration

    while(product<100) // while loop

   {

       scanf("%d",&number); // input a number

       product= number*10; // multiply the number by product

       printf("%d\n",product); // print the value of product

   }

 return 0; // return statement

}

Output:

  • If the user enter 10 then the loop terminates for the first time and the output is 100.
  • If the user enter 5,10 then the loop executes in 2 times and the output is 50 and 100.

Explanation:

  • Firstly there is an inclusion of header file which understands the meaning of printf() and scanf() function.
  • Then there is the main() function definition
  • Then we declare a two-variable (number and product) of integer type.
  • Then we define a while loop and check the condition that product value is less than 100 or not.
  • Then we take input and multiply by 10.
  • Then we assign the value in the product and print the product value.
6 0
3 years ago
Suppose that you want to write a program that inputs customer data and displays a summary of the number of customers who owe mor
Allushta [10]

Answer:

The correct option is D = regionNumber

Explanation:

In this scenario we want to know customers who owe more than $1000 each, in each of 12 sales regions. And the customer data variables include name, zip-code, balanceDue and regionNumber; based on the customer data variables names and zip-code will not really affect our output. It is based on balanceDue that we increment the number of customer owing in a particular region (regionNumber).

Therefore, we would add 1 to an array element whose subscript would be represented by regionNumber since we are interested to know the number of customer owing in each of the 12 sales regions.

3 0
3 years ago
Other questions:
  • The c++ operator _______________ is used to destroy dynamic variables.
    5·1 answer
  • Henry is troubleshooting a network connection and wants to see if he can connect to the server on his network. Which Microsoft c
    14·1 answer
  • Arpenet was the computer created by the military true or false
    13·1 answer
  • How does a hard drive work
    6·2 answers
  • Do you know Aztekium Bot?
    10·2 answers
  • Assume that month is an int variable whose value is 1 or 2 or 3 or 5 ... or 11 or 12. Write an expression whose value is "jan" o
    10·1 answer
  • Create detailed pseudocode for a program that calculates how many days are left until Christmas, when given as an input how many
    15·1 answer
  • Ryan is looking to buy a new HDTV set. He knows from friends that LCD set screens reflect less light than plasma set screens, bu
    10·1 answer
  • Managers can use __ software to discuss financial performance with the help of slides and charts
    11·1 answer
  • Create a program that calculates three options for an appropriate tip to leave after a meal at a restaurant.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!