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
mojhsa [17]
4 years ago
9

Warm up: Variables, input, and casting

Computers and Technology
1 answer:
Dafna11 [192]4 years ago
5 0

Answer:

#include <stdio.h>

int main()

{

   int userInt;

   double userDouble;

   char userChar;

   char userString[50];

   

   printf("Enter integer: \n");

   scanf("%d", &userInt);

   

   printf("Enter double: \n");

   scanf("%lf", &userDouble);

   

   printf("Enter character: \n");

   scanf(" %c", &userChar);

   

   printf("Enter string: \n");

   scanf("%s", userString);

   

   printf("%d %lf %c %s \n", userInt, userDouble, userChar, userString);

   printf("%d %lf %c %s %s %c %lf %d \n", userInt, userDouble, userChar, userString, userString, userChar, userDouble, userInt);

   printf("%d %lf %c %s %s %c %lf %d %lf cast to an integer is %d \n", userInt, userDouble, userChar, userString, userString, userChar, userDouble, userInt, userDouble, (int)userDouble);

   return 0;

}

Explanation:

In addition to int and double, declare the char and string

In addition to the int, ask the user to enter the double, char and string

Print the variables in the same order as they entered

In addition to entered order, also print the variables in reverse order - type the variables in reverse order

In addition to reverse order, print the casting value of the double as int - to cast a double to an int put (int) before the variable name

You might be interested in
Python Programming
Phoenix [80]

The python program that creates a Bankaccount class for a Bank ATM that is made up of the customers and has a deposit and withdrawal function is given below:

<h3>Python Code</h3>

# Python program to create Bankaccount class

# with both a deposit() and a withdraw() function

class Bank_Account:

def __init__(self):

 self.balance=0

 print("Hello!!! Welcome to the Deposit & Withdrawal Machine")

def deposit(self):

 amount=float(input("Enter amount to be Deposited: "))

 self.balance += amount

 print("\n Amount Deposited:",amount)

def withdraw(self):

 amount = float(input("Enter amount to be Withdrawn: "))

 if self.balance>=amount:

  self.balance-=amount

  print("\n You Withdrew:", amount)

 else:

  print("\n Insufficient balance ")

def display(self):

 print("\n Net Available Balance=",self.balance)

# Driver code

# creating an object of class

s = Bank_Account()

# Calling functions with that class object

deposit()

s.withdraw()

s.display()

Read more about python programming here:

brainly.com/question/26497128

#SPJ1

8 0
2 years ago
How do you move a slide to another location in you your<br> presentation?
ludmilkaskok [199]

Answer: Literally click on it and hold, then just drag it to wherever you want it

Explanation: Hope this helped you

5 0
3 years ago
You must create an instructional video for your company and are required to ensure it is compatible with your company's windows
enyata [817]
The best video format which should be chosen when creating an instructional video is WMV format. At first, you are asked to make video which will <span>compatible with windows systems and since WMV format is a</span><span> part of the </span>Windows Media<span> framework it is a sensible choice. WMV can be also put into the AVI container format which is quite common among the users.</span>
7 0
4 years ago
What's the name of the file mainly used to save power point
son4ous [18]
.PPT is the extention for the files downloaded from Powerpoint.
7 0
3 years ago
Read 2 more answers
Have you ever tried using such a camera?​
guapka [62]

Answer: yeah i mean i use my canon camera

Explanation:

7 0
3 years ago
Other questions:
  • Isp servers are continually connected to a larger network, called a regional network, which, in turn, is connected to one of the
    6·1 answer
  • A(n) _____ might be written by a programmer or it might be created through a DBMS utility program.
    6·1 answer
  • Which of these practices should you follow while creating your résumé?
    14·1 answer
  • You notice that it’s very easy to confuse medications at the community health center where you’re working. They are lined up on
    10·1 answer
  • What is the purpose of citations?
    13·1 answer
  • After you have created at least four slides, a scroll bar containing scroll arrows and scroll boxes will appear on the right edg
    9·1 answer
  • How do you create a IOS app?
    12·1 answer
  • Research: Using the Internet or a library, gather information about the Columbian Exchange. Takes notes about the specific goods
    15·1 answer
  • What are the best legendary pokemon?
    15·2 answers
  • How does communication produce clarity and direction​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!