Write a function- oriented to convert the input dollar(s)
into its equivalent peso. Assume that one dollar is
equivalent to 51.60



Write a function- oriented to convert the input dollar(s) into its equivalent peso. Assume that one..

Answer / sreejesh1987


void main()
{
float dlr;
float peso(float d);
clrscr();
printf("Enter the amount of dollors with you: ");
scanf("%f",&dlr);
printf("\nYour dollars are equivalent to %.2f
peso",peso(dlr));
getch();

}
float peso(float x)
{
return x*51.60;
}

Is This Answer Correct ?    9 Yes 20 No

Post New Answer

More C++ Code Interview Questions

A Binary no. is given, we hav to find it's decimal equivalent.

2 Answers   Microsoft,


program to find the magic square using array

1 Answers  


write a program that can LOCATE and INSERT elements in array using c++ programming languages.

0 Answers  


write a program that calculate the volume of cylinder after user enters radius and height and show the algorithm used

1 Answers   Jomo Kenyatta University,


Definition of priority queue was given. We have to implement the priority queue using array of pointers with the priorities given in the range 1..n. The array could be accessed using the variable top. The list corresponding to the array elements contains the items having the priority as the array index. Adding an item would require changing the value of top if it has higher priority than top. Extracting an item would require deleting the first element from the corresponding queue. The following class was given: class PriorityQueue { int *Data[100]; int top; public: void put(int item, int priority); // inserts the item with the given priority. int get(int priority); // extract the element with the given priority. int count(); // returns the total elements in the priority queue. int isEmpty(); // check whether the priority queue is empty or not. }; We had to implement all these class functions.

0 Answers   Nagarro, Wollega University,






What will be the output- for(i=1;i<=3;i++) { printf("%d",i); continue; i++; }

5 Answers   Impetus,


How to Split Strings with Regex in Managed C++ Applications?

0 Answers   Microsoft,


using friend function find the maximum number from given two numbers from two different classes.write all necessary functions and constructor for the classes.

1 Answers   TCS,


PROBLEM #8 The cashier at the counter of a Super Store, Mr. Khazaanchi has the following bundles of rupee cash notes with him: Rs. 1, 2, 5, 10, 50, 100, 500, 1000 A customer comes at his counter with various items that he has shopped. Mr. Khazaanchi totals the item prices and tells the customer his total amount payable. The customer gives Mr. Khazanchi some amount of cash. Find the total number of rupee notes of each denomination (i.e. 1, 2, 5, 10, 50, 100, 500, 1000) Mr. Khazaanchi will have to give to the withdrawer ensuring that the total number of rupee notes are minimum.

1 Answers   AR, ARJ,


output for printf("printf");

0 Answers  


Given 1 to n distinct random number of which n+1th element was duplicated. How do find the duplicate element and explain the time complexity of the algorithm.

0 Answers   Microsoft, NetApp,


develop a program to calculate and print body mass index for 200 employees

0 Answers   Jomo Kenyatta University,


Categories