Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

** Basic C Programming , Help please! Write a program that converts a number of

ID: 664035 • Letter: #

Question

**Basic C Programming, Help please!

Write a program that converts a number of pennies to its larger coin equivalent. The
      program should ask the user to enter an amount as a decimal number such a 1.60 for
      1 hundred sixty pennies. The program should then report how many quarters,
      dimes, nickels, and pennies it would take to make that amount of change.

(note*: Its C programming, Just started so code has to be the most basic it can be, so that i can understand and learn it.)

(Please enter the amount of money you have: 1.60
$1.60 is equivalent to:
Quarters:
Dimes:
Nickels:
Pennies: )

----------------------------------------

Write a program that asks the user to enter four integers. Using ONLY
     4 if statements, the program should output the largest and smallest
     integer.

Explanation / Answer

2) Program that outputs the largest nd smallest integer

#include<stdio.h>

#include<conio.h>
void main()

{

int a,b,c,d;

printf(" enter the four integers");

scanf("%d%d%d%d", &a,&b,&c,&d);

if((a>b)&&(a>c)&&(a>d))

printf("a is the largest number");

else if((b>a)&&(b>c)&&(b>d))

printf("b is the largest number");

else if((c>a)&&(c>b)&&(c>d));

printf("c is the largest number");

else if((d>a)&&(d>b)&&(d>c))

printf("d is the largest number");

if((a<b)&&(a<c)&&(a<d))

printf("a is the smallest number");

else if((b<a)&&(b<c)&&(b<d))

printf("b is the smallest number");

else if((c<a)&&(c<b)&&(c<d));

printf("c is the smallest number");

else if((d<a)&&(d<b)&&(d<c))

printf("d is the smallest number");

printf(" ");

return 0;

}

1)Program that converts number of Pennies into large coin equivalent

#include<stdio.h>

#include<conio.h>

void main()

{

int money;

int penny = 1;

int dime = 10;

int quarter = 25;

int nickel = 5;

int coin;

int total;

printf(" enter in dollar amount to convert to change");

scanf(" %d",&money);

printf(" to determine how many penny's , nickles, dimes or quarters");

printf(" pennies or nickel or dime or quarter ");

scanf("%d", coin);

if (money <=1)

{

return -1;

elseif( coin == penny)

return (total = (money *100)/coin);

elseif( coin == nickel)

return (total = (money *100)/coin);

elseif( coin == dime)

return (total = (money *100)/coin);

elseif( coin == quarter)

return (total = (money *100)/coin);

}

printf(" the result is = total ");

}