₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,117 members, 8,420,451 topics. Date: Thursday, 04 June 2026 at 08:02 PM

Toggle theme

Who Can Write This C Program - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingWho Can Write This C Program (1613 Views)

1 Reply (Go Down)

Who Can Write This C Program by subi(op): 9:56am On Apr 17, 2009
Pls am having problem writing this program who can help me out

1. Write a program to accept itm names, price and quantity of five items in a structural array and display it in descending order of price. it shld also display the itms names with the hishest price.

2. program that can merger 2 files into one.

3. Program that will count the total odd and even number btw 1 and 100

4. A program that can accept data into a file and it should prit it in reverse order and it will transfer only the vowel data into a file.

Please if you can help me on how to go abt this questins kindly reply me invltd@yahoo.com
And tell me ur terms, as this is urgent
Re: Who Can Write This C Program by jacob05(m): 4:21pm On Apr 21, 2009
This is why i love Python, simple apps that can be written in a clean and fine language . And about your  C app i will see what i can do about that. My advice . learn Python
Re: Who Can Write This C Program by Frizy(m): 9:54pm On Apr 21, 2009
subi:
Pls am having problem writing this program who can help me out

1. Write a program to accept itm names, price and quantity of five items in a structural array and display it in descending order of price. it shld also display the itms names with the hishest price.

2. program that can merger 2 files into one.

3. Program that will count the total odd and even number btw 1 and 100

4. A program that can accept data into a file and it should prit it in reverse order and it will transfer only the vowel data into a file.

Please if you can help me on how to go abt this questins kindly reply me invltd@yahoo.com
And tell me ur terms, as this is urgent
hey, I would help you solve the problems but please don't tell anyone. I suspect this is a school assignment. If caught, this is called cheating, and am liable to penalties myself.
Re: Who Can Write This C Program by Frizy(m): 9:55pm On Apr 21, 2009
3. Program that will count the total odd and even number btw 1 and 100
//Program that will count the total odd and even number btw 1 and 100

#include<iostream>
#include<iomanip>
using namespace std;

int main()
{
int even=0;
int odd=0;
for(int i=1;i<=100;i++)
{
if (i%2==0)
{
even++;
}
else
odd++;
}
cout<<"The number of Odd and Even between 1 to 100 is"<<setw(5)<<odd<<"Odds"<<setw(5)<<even<<"evens"<<endl;

return 0;


}
Re: Who Can Write This C Program by Frizy(m): 10:58pm On Apr 21, 2009
1. Write a program to accept itm names, price and quantity of five items in a structural array and display it in descending order of price. it shld also display the itms names with the hishest price.
/*Write a program to accept itm names, price and quantity of five items in a structural array
and display it in descending order of price. it shld also display the itms names with the hishest price*/

#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
int min_price (int quantity[], int size);
string return_item(string item_names,int quantity[], int size);

int main()
{
string item_names;
float price;
int times=0;

do
{
cout<<"Item name?"<<endl;
cin>>item_names;
cout<<"price"<<endl;
cin>>price;
times++;
}while(times!=5);

int min_price (int arrays[], int length);
string return_item(string item_names,int quantity[], int size);

return 0;
}

//Display in descending order of price
int size=5;
int min_price(int quantity[], int size)
{
int min = quantity[0];
for (int i=1; i < size; i++)
if (quantity[i] < min) min = quantity[i];
return min; }

//display the itms names with the hishest price
string return_item(string item_names,int quantity[], int size)
{
cin>>item_names;
int max = quantity[0];
for (int i=1; i < size; i++)
{
if (quantity[i] > max) max = quantity[i];
return item_names;
}
}
Re: Who Can Write This C Program by Frizy(m): 11:03pm On Apr 21, 2009
Now I may or may not continue tomorrow, it really depends on my mood. wink
Re: Who Can Write This C Program by IbrahimB: 5:44pm On Apr 23, 2009
@Frizy:
Well done! I think the way you solved the odd/even problem is quite elegant. (Even though the solution you gave was actually C++ and not C)
cheesy
Probably he's found a solution, coz sent him an email and he hasn't replied.

Ibrahim
Re: Who Can Write This C Program by Frizy(m): 6:04pm On Apr 23, 2009
IbrahimB:
@Frizy:
Well done! I think the way you solved the odd/even problem is quite elegant. (Even though the solution you gave was actually C++ and not C)
cheesy
Probably he's found a solution, coz sent him an email and he hasn't replied.

Ibrahim
Thanks man, maybe he found a solution. Are you a cs studenthuh
Re: Who Can Write This C Program by IbrahimB: 6:30pm On Apr 23, 2009
@Frizy: I'm a Software Developer though a graduate of EE Engineering
1 Reply

Help! Im Stuck With This C# ProgramPlease Programmars Help Me Out With This C# Program! I Have Test Tommorrow!!!!!A Simple C++ Program That Evaluates A Simple And Compound Interest234

Loans/project Finance On Profit Sharing BasisJava Deployment HelpQuotes Needed For Website Development