| | |
need some help
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Sep 2006
Posts: 16
Reputation:
Solved Threads: 0
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.
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.
•
•
•
•
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.
バルサミコ酢やっぱいらへんで
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.
If you want to win, you must not loose (Alan Ford)
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.
I don't accept change; I don't deserve to live.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
> 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.
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.
•
•
Join Date: Sep 2006
Posts: 38
Reputation:
Solved Threads: 1
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
I don't know, maybe this will help
•
•
Join Date: Sep 2006
Posts: 16
Reputation:
Solved Threads: 0
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++)
#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.
•
•
Join Date: Sep 2006
Posts: 16
Reputation:
Solved Threads: 0
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();
}
#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();
}
![]() |
Other Threads in the C Forum
- Previous Thread: C program
- Next Thread: c programming help (2)
Views: 2293 | Replies: 10
| Thread Tools | Search this Thread |
Tag cloud for C
#include * .net append array arrays bash binarysearch changingto char character cm copyanyfile copypdffile createprocess() database directory drawing dynamic execv feet fgets file floatingpointvalidation fork function functions getlogicaldrivestrin givemetehcodez global grade graphics gtkwinlinux histogram homework i/o ide include infiniteloop initialization input interest intmain() iso keyboard kilometer lazy license linked linkedlist linux list looping loopinsideloop. lowest matrix meter microsoft mqqueue mysql oddnumber odf open openwebfoundation overwrite pause pdf pointer pointers posix power process program programming pyramidusingturboccodes read recursion recv recvblocked reversing segmentationfault single socket socketprogramming spoonfeeding standard strchr string student suggestions system test testing threads unix urboc user whythiscodecausesegmentationfault win32api windowsapi






