Question
*---------------------------------------------------------------------------*/ /* PROGRAM : Complete/fix the program below in order for it to work properly */ /*---------------------------------------------------------------------------*/ /* Include the libraries needed */ #include int
*---------------------------------------------------------------------------*/
/* PROGRAM : Complete/fix the program below in order for it to work properly */
/*---------------------------------------------------------------------------*/
/* Include the libraries needed */
#include
int main()
{
/* Declare variables */
int A={4,5,7,10,11,29,3,21,12,-9};
/*--------------------*/
/* DATA TYPE PRACTICE */
/*--------------------*/
/* Input an integer from the keyboard */
printf("input an integer :");
scanf("",);
/*print the integer as integer */
printf("the number printed as integer : ",);
/*print the integer as float */
printf("the number printed as float : ",);
/*print the integer as double */
printf("the number printed as double : ",);
/* Input a floating point number from the keyboard */
printf("input a float number :");
scanf("",);
/*print the float as integer */
printf("the number printed as integer : ",);
/*print the float as float */
printf("the number printed as float : ",);
/*print the float as double */
printf("the number printed as double : ",);
/* Input a double from the keyboard */
printf("input a double number :");
scanf("",);
/*print the double as integer */
printf("the number printed as integer : ",);
/*print the double as float */
printf("the number printed as float : ",);
/*print the double as double */
printf("the number printed as double : ",);
/* Print the float number without precision format*/
printf("The float number is : ", );
/* Print the float number at least 6 places and 2 decimal places after decimal point*/
printf("The float number with 6 places and 2 decimal places precision is : ", );
/* Print the float number at least 6 places and 3 decimal places after decimal point*/
printf("The float number with 6 places and 3 decimal places precision is : ", );
/* Print the float number in scientific notation with 3 decimal places after decimal point */
printf("The scientific notation with 3 decimal places after the dot is : ", );
/*------------------------*/
/* MATH OPERATION */
/*------------------------*/
/* Multiply integer with double and display the result in double without a result variable */
printf("(double)%lf x (integer)%d = (double)%lf ",,,);
/* Multiply integer with double and display the result in integer without a result variable*/
printf("(double)%lf x (integer) %d = (integer) %d ",,,);
/* Division double and integer and display the result in double without a result variable */
printf("(double) %lf / (integer) %d = (double) %lf ",,,);
/* Division double and integer and display the result in integer without a result variable */
printf("(double) %lf / (integer) %d = (integer) %d ",,,);
/* Multiplication int and int and display the result in double without a result variable */
printf("(integer) %d x (integer) %d = (double) %lf ",,,);
/* Multiplication int and int and display the result in a double variable */
printf("(integer) %d x (integer) %d = (double) %lf ",,,);
/*--------------------*/
/* LOOP PRACTICE */
/*--------------------*/
/* Print a sequence of integer multiplication of n from 0 to 100 (horizontally separated by comas) */
/* example : 0,50,100 */
/* Use the integer available from previous process as n */
printf("Sequence of integer multiplication of %d is ",intnum);
/* Using 'for' loop */
/* Using 'while' loop */
/*--------------------*/
/* SELECTION PRACTICE */
/*--------------------*/
/* Determine if each component in A is smaller, equal or bigger than 10 */
/* The format of display is : (if A is [1,45,10]) */
/* 1 - smaller */
/* 45 - bigger */
/* 10 - equal */
/* */
/* A is given in the beginning of this program. You may change the com */
/* ponents but has to have all three possibilities */
/* THE NUMBERS AND DASHES SHOULD BE LINED-UP */
/* Using the 'if/else */
/* END */
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started