943,793 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 2621
  • C RSS
You are currently viewing page 1 of this multi-page discussion thread
Sep 28th, 2006
0

need some help

Expand Post »
hello guys
i am new in this forum and in programing
i want to write a program which could convert given temperature and its unit into oher scales please give me some sugestions and ideas bout that
and i need to know how to declear chareters and how to take inputs of characters
Looking forward for yopur help
thanks
saqib.
Last edited by saqib; Sep 28th, 2006 at 10:45 pm.
Reputation Points: 14
Solved Threads: 0
Newbie Poster
saqib is offline Offline
16 posts
since Sep 2006
Sep 28th, 2006
0

Re: need some help

Click to Expand / Collapse  Quote originally posted by saqib ...
please give me some sugestions and ideas bout that and i need to know how to declear chareters and how to take inputs of characters
saqib.
How about buying a C/C++ book, or taking a C/C++ class or reading a C/C++ tutorial?
Moderator
Reputation Points: 572
Solved Threads: 115
Mentally Challenged Mod.
WolfPack is offline Offline
1,559 posts
since Jun 2005
Sep 29th, 2006
1

Re: need some help

With which part do you have problem? Formula for conversion or programming issue? For formulas, read this. For declaring char and inputting you got the answer from second post of this thread
Last edited by andor; Sep 29th, 2006 at 5:05 am.
Reputation Points: 251
Solved Threads: 29
Posting Whiz in Training
andor is offline Offline
274 posts
since Jun 2005
Sep 29th, 2006
1

Re: need some help

Yeah post your effort here and then maybe we would be able to help you out, just asking for code here would not fetch much help.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006
Sep 29th, 2006
1

Re: need some help

> i want to write a program which could convert given temperature and its unit into oher scales
Start with centigrade to centigrade.

Very trivial conversion, but it at least gets you to attempt the first part of actually attempting the "prompt the user and get answers" part of the program.

Then we at least will know which part of the problem you're really stuck on and we can advise accordingly.
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005
Sep 29th, 2006
1

Re: need some help

Are you trying to write this program in C or C++? Have you tried to write the program yet? Show us what you have so far.
Reputation Points: 42
Solved Threads: 1
Light Poster
hoosier23 is offline Offline
25 posts
since Jun 2006
Sep 29th, 2006
1

Re: need some help

1: #include <iostream.h>2:3: float Convert(float);4: int main()5: {6: float TempFer;7: float TempCel;8:9: cout << "Please enter the temperature in Fahrenheit: ";10: cin >> TempFer;11: TempCel = Convert(TempFer);12: cout << "\nHere's the temperature in Celsius: ";13: cout << TempCel << endl;14: }15:16: float Convert(float Fer)17: {18: float Cel;19: Cel = ((Fer - 32) * 5) / 9;20: return Cel;21: }You should get the same
I don't know, maybe this will help
Reputation Points: 79
Solved Threads: 1
Light Poster
CurtisBridges is offline Offline
38 posts
since Sep 2006
Sep 29th, 2006
0

Re: need some help

in two weeks of learning c. ihave wrote the following programs
#include<stdio.h>
#include<math.h>
#include<conio.h>
void main(void)
{
int a_int,b_int,c_int,root1_int,root2_int;
printf("The Quadratic Equation\na*x*x+b*x+c=0\n");
printf("Value Of a_int\n");
scanf("%d",&a_int);
printf("Value Of b_int\n");
scanf("%d",&b_int);
printf("Value Of c_int");
scanf("%d",&c_int);
root1_int=(-b_int+sqrt(b_int*b_int-4*a_int*c_int))/(2*a_int);
printf("root1_int is%d\n",root1_int);
root2_int=-(b_int-sqrt(b_int*b_int-4*a_int*c_int))/(2*a_int);
printf("root2_int is%d\n",root2_int);
getche();
}
2
#include<stdio.h>
#include<conio.h>
void main(void)
{
int radius,volume,area;
printf("finding area and volume of a sphere);
printf("give the radius of sphere\n");
scanf("%d",&radius);
volume=(4/3)*3.14*radius*radius*radius;
printf("Volume Of Sphere is\n%d",volume);
area=4*3.14*radius*radius;
printf("\nArea Of Sphere is\n%d",area);
}
and some others
thanks for ur support now iam writing aprogramm which can find factorial but it is not working
#include<stdio.h>
void main(void)
{
int i,j,s,f,n;
printf("value of num");
scanf("%D",&n);
s=0;
{
for(i=1,i<=n,n++);
{
for(j=i,j>=1,j--);
}
s=i/f+s;
f=i;
}
printf("sum=%d"sum);
}
I am learning from book of Robert Lafore(Cprogramming Using Turbo C++)
Last edited by saqib; Sep 29th, 2006 at 8:58 pm.
Reputation Points: 14
Solved Threads: 0
Newbie Poster
saqib is offline Offline
16 posts
since Sep 2006
Sep 29th, 2006
1

Re: need some help

the temperature program is runing now
#include<stdio.h>
#include<conio.h>
void main(void)
{
int kelvin,centigrade,fahrenheit;
printf("temperature in kelvin\n");
scanf("%d",&kelvin);
centigrade=kelvin-273;
printf("temperature in centigrade is\n%d,degree centigrades ",centigrade);
fahrenheit=(centigrade*9/5)+32;
printf("\ntemperature in fahrenheit is\n%d,degree fahrenheits ",fahrenheit);
getch();
}
Reputation Points: 14
Solved Threads: 0
Newbie Poster
saqib is offline Offline
16 posts
since Sep 2006
Sep 30th, 2006
1

Re: need some help

Use code tags and don't use void main (read this)
Reputation Points: 251
Solved Threads: 29
Posting Whiz in Training
andor is offline Offline
274 posts
since Jun 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: C program
Next Thread in C Forum Timeline: c programming help (2)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC