68 721
Assignments Done
Successfully Done
In January 2019

Answer to Question #44884 in C for marinel dalangay

Question #44884
create a program that will ask the users to input a price of the item and will display its coded value as
c o m p u t e r c y
0 1 2 3 4 5 6 7 8 9
for exam the output is:
enter the price of the item: 123.4
the coded price is: omp.u
Expert's answer
#include <stdio.h>
#include <stdlib.h>
//main function
int main(){ 
  char code[]={'c','o','m','p','u','t','e','r','c','y'};
       char price[20];
  //prompt user the price of the item
       printf("Enter the price of the item: ");
  //read  price
  //display the coded price is: 
  int i=0;
  printf("The coded price is: ");
     int number =price[i] - '0';
 if(number>=0 && number<10){
   //show code
//show . or other symbol
 //increment i
    return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions