| Forum |
|
|||||||
| Programming The destination for developers - C, C++, Java, Python and the lot |
![]() |
|
|
LinkBack (1) | Thread Tools | Display Modes |
| Advertisements. Register and be a member of the community to get rid of them. | |
|
Advertisement
|
|
|
|
#2 (permalink) |
|
NP : Crysis
Join Date: Mar 2007
Location: City 17
Posts: 1,415
|
here's a prog to calc area, surface area, volume, total surface area etc. of numerous 2D and 3D figures using functions
i had made this one for a friend - it was his project Code:
#include<iostream.h>
#include<conio.h>
#include<math.h>
void line(void);
void cuboid(void);
void cube(void);
void cylinder(void);
void cone(void);
void sphere(void);
void hemisphere(void);
void triangle(void);
void rectangle(void);
void square(void);
void circle(void);
void parallelogram(void);
void main()
{
clrscr();
int o1,o2;
menu:
do{
clrscr();
cout<<"\n\n1. 3-D Figures"
<<"\n\n2. Plane Figures"
<<"\n\n3. Exit"
<<"\n\nEnter your choice -->\t";
cin>>o1;
switch(o1)
{
case 1: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\t3-D Figures\n\n";
line();
cout<<"\n\n1. Cuboid"
<<"\n\n2. Cube"
<<"\n\n3. Cylinder"
<<"\n\n4. Cone"
<<"\n\n5. Sphere"
<<"\n\n6. Hemisphere"
<<"\n\n7. Main Menu"
<<"\n\nEnter your choice -->\t";
cin>>o2;
switch(o2)
{
case 1: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tCuboid\n\n";
line();
cuboid();
getch();
break;
case 2: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tCube\n\n";
line();
cube();
getch();
break;
case 3: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tCylinder\n\n";
line();
cylinder();
getch();
break;
case 4: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tCone\n\n";
line();
cone();
getch();
break;
case 5: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tSphere\n\n";
line();
sphere();
getch();
break;
case 6: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tHemisphere\n\n";
line();
hemisphere();
getch();
break;
case 7: goto menu;
default: cout<<"\n\nInvalid Input\a\a\a";
goto menu;
}
getch();
break;
case 2: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tPlane Figures\n\n";
line();
cout<<"\n\n1. Traingle"
<<"\n\n2. Rectangle"
<<"\n\n3. Sqaure"
<<"\n\n4. Circle"
<<"\n\n5. Parallelogram"
<<"\n\n6. Main Menu"
<<"\n\nEnter your choice -->\t";
cin>>o2;
switch(o2)
{
case 1: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tTraingle\n\n";
line();
triangle();
getch();
break;
case 2: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tRectangle\n\n";
line();
rectangle();
getch();
break;
case 3: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tSquare\n\n";
line();
square();
getch();
break;
case 4: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tCircle\n\n";
line();
circle();
getch();
break;
case 5: clrscr();
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tParallelogram\n\n";
line();
parallelogram();
getch();
break;
case 6: goto menu;
default: cout<<"\n\nInvalid Input\a\a\a";
goto menu;
}
getch();
break;
case 3: cout<<"\n\nPress any key to exit...\a";
getch();
break;
default: cout<<"\n\nInvalid Input\a\a\a\a";
goto menu;
}
}while(o1!=3);
}
void line()
{
int i;
for (i=0;i<80;i++)
cout<<"*";
}
void cuboid()
{
float l,b,h,a,v;
cout<<"\n\nEnter length of cuboid -->\t";
cin>>l;
cout<<"\n\nEnter breadth of cuboid -->\t";
cin>>b;
cout<<"\n\nEnter height of cuboid -->\t";
cin>>h;
v=l*b*h;
a=2*(l*b+b*h+l*h);
cout<<"\n\nVolume of cuboid is "<<v;
cout<<"\n\nSurface area of cuboid is "<<a;
}
void cube()
{
float l,a,v;
cout<<"\n\nEnter length of side of cube -->\t";
cin>>l;
v=l*l*l;
a=6*l*l;
cout<<"\n\nVolume of cube is "<<v;
cout<<"\n\nSurface area of cube is "<<a;
}
void cylinder()
{
float r,h,v,c,t;
cout<<"\n\nEnter radius of cylinder -->\t";
cin>>r;
cout<<"\n\nEnter height of cylinder -->\t";
cin>>h;
v=3.14*r*r*h;
c=2*3.14*r*h;
t=3.14*r*(2*h+r);
cout<<"\n\nVolume of cylinder is "<<v;
cout<<"\n\nCurved Surface Area of cylinder is "<<c;
cout<<"\n\nTotal Surface Area of cylinder is "<<t;
}
void cone()
{
float r,h,l,v,c,t;
cout<<"\n\nEnter radius of cone -->\t";
cin>>r;
cout<<"\n\nEnter height of cone -->\t";
cin>>h;
l=sqrt(r*r+h*h);
v=(3.14*r*r*h)/3;
c=3.14*r*l;
t=3.14*r*(l+r);
cout<<"\n\nSlant height of cone is "<<l;
cout<<"\n\nVolume of cone is "<<v;
cout<<"\n\nCurved Surface Area of cone is "<<c;
cout<<"\n\nTotal Surface Area of cone is "<<t;
}
void sphere()
{
float r,v,a;
cout<<"\n\nEnter radius of sphere -->\t";
cin>>r;
v=(4*3.14*r*r*r)/3;
a=4+3.14*r*r;
cout<<"\n\nVolume of sphere is "<<v;
cout<<"\n\nSurface Area of sphere is "<<a;
}
void hemisphere()
{
float r,v,c,t;
cout<<"\n\nEnter radius of hemisphere -->\t";
cin>>r;
v=(2*3.14*r*r*r)/3;
c=2*3.14*r*r;
t=3*3.14*r*r;
cout<<"\n\nVolume of hemisphere is "<<v;
cout<<"\n\nCurved Surface Area of hemisphere is "<<c;
cout<<"\n\nTotal Surface Area of hemisphere is "<<t;
}
void triangle()
{
float b,h,a;
cout<<"\n\nEnter base of triangle -->\t";
cin>>b;
cout<<"\n\nEnter height of triangle -->\t";
cin>>h;
a=(b*h)/2;
cout<<"\n\nArea of the triangle is "<<a;
}
void rectangle()
{
float l,b,a,p;
cout<<"\n\nEnter length of rectangle -->\t";
cin>>l;
cout<<"\n\nEnter breadth of rectangle -->\t";
cin>>b;
a=l*b;
p=2*(l+b);
cout<<"\n\nArea of rectangle is "<<a;
cout<<"\n\nPerimeter of rectangle is "<<p;
}
void square()
{
float s,a,p;
cout<<"\n\nEnter length of side of square -->\t";
cin>>s;
a=s*s;
p=4*s;
cout<<"\n\nArea of square is "<<a;
cout<<"\n\nPerimeter of square is "<<p;
}
void circle()
{
float r,a,c;
cout<<"\n\nEnter radius of circle -->\t";
cin>>r;
a=3.14*r*r;
c=2*3.14*r;
cout<<"\n\nArea of circle is "<<a;
cout<<"\n\nCircumference of circle is "<<c;
}
void parallelogram()
{
float b,h,a,p;
cout<<"\n\nEnter base of parallelogram -->\t";
cin>>b;
cout<<"\n\nEnter height of parallelogram -->\t";
cin>>h;
a=b*h;
p=2*(b+h);
cout<<"\n\nArea of parallelogram is "<<a;
cout<<"\n\nPerimeter of parallelogram is "<<p;
}
__________________
Gaming: Phenom II x4 965BE @ 3.6Ghz/Corsair H50 Liquid Cooling/MSI 790FX-GD70/2x2GB GSkill Ripjaws 7-7-7-24/3 x GTX 470 w/Zalman VF3000F/Corsair 850W PSU/Antec 1200/2xSpinpoint F3 500Gb RAID 0 |
|
|
|
|
#3 (permalink) |
|
IM AS MAD AS HELL!!
Join Date: Oct 2006
Location: localhost
Posts: 1,596
|
My Program to calculate Addition
Code:
#include <stdlib.h>
main()
{
float a,b,c,total,multiply,add,input;
printf("Welcome to Demon Calculator \n\n");
printf("Enter the values-\n\n");
printf("a:");
scanf("%f",&a);
printf("b:");
scanf("%f",&b);
printf("c:");
scanf("%f",&c);
total=a*b*c;
if (total>80000)
printf("Meri Marzi , tu khud solve kar.\a\a\a\a\a\a\a\a\a\n\n");
else
printf("The answer is %f\n\n\a\a",total);
system("pause");
}
__________________
When someone dies in the grip of a powerful rage... a curse is born. Kayako Saeki: Croakkkkkkkkkkkkkkkkkkkkk! |
|
|
|
|
#5 (permalink) | |||
|
The Lord of Death
Join Date: May 2005
Location: यमलोक
Posts: 253
|
Quote:
Quote:
Quote:
Last edited by Yamaraj; 02-09-2007 at 04:58 PM. Reason: Automerged Doublepost |
|||
|
|
|
|
#6 (permalink) |
|
Pawned!... Beyond GODLIKE
Join Date: May 2006
Location: World Of Warcraft -DOTA
Posts: 1,003
|
+no the program is correct dude
__________________
If God has indeed created Himself in His own image, then I submit to you that God is a cockroach |
|
|
|
|
#7 (permalink) |
|
Dreamweaver
Join Date: Aug 2006
Location: Bangalore
Posts: 3,885
|
i added the return statement, is it rite now?
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore Follow me on twitter.com/gigacore |
|
|
|
|
#9 (permalink) | |
|
Commander in Chief
Join Date: Jul 2005
Posts: 6,657
|
Quote:
Anyway, here's xbonez's program in proper code Code:
#include<iostream>
#include<math.h>
using namespace std;
void line(void);
void cuboid(void);
void cube(void);
void cylinder(void);
void cone(void);
void sphere(void);
void hemisphere(void);
void triangle(void);
void rectangle(void);
void square(void);
void circle(void);
void parallelogram(void);
int main()
{
int o1,o2;
do{
cout<<"\n\n1. 3-D Figures"
<<"\n\n2. Plane Figures"
<<"\n\n3. Exit"
<<"\n\nEnter your choice -->\t";
cin>>o1;
switch(o1)
{
case 1: cout<<"\n\n";
line();
cout<<"\n\t\t\t\t3-D Figures\n\n";
line();
cout<<"\n\n1. Cuboid"
<<"\n\n2. Cube"
<<"\n\n3. Cylinder"
<<"\n\n4. Cone"
<<"\n\n5. Sphere"
<<"\n\n6. Hemisphere"
<<"\n\n7. Main Menu"
<<"\n\nEnter your choice -->\t";
cin>>o2;
switch(o2)
{
case 1: cout<<"\n\n";
line();
cout<<"\n\t\t\t\tCuboid\n\n";
line();
cuboid();
break;
case 2: cout<<"\n\n";
line();
cout<<"\n\t\t\t\tCube\n\n";
line();
cube();
break;
case 3: cout<<"\n\n";
line();
cout<<"\n\t\t\t\tCylinder\n\n";
line();
cylinder();
break;
case 4: cout<<"\n\n";
line();
cout<<"\n\t\t\t\tCone\n\n";
line();
cone();
break;
case 5: cout<<"\n\n";
line();
cout<<"\n\t\t\t\tSphere\n\n";
line();
sphere();
break;
case 6: cout<<"\n\n";
line();
cout<<"\n\t\t\t\tHemisphere\n\n";
line();
hemisphere();
break;
case 7: break;
default: cout<<"\n\nInvalid Input\a\a\a";
}
break;
case 2:
cout<<"\n\n";
line();
cout<<"\n\t\t\t\tPlane Figures\n\n";
line();
cout<<"\n\n1. Traingle"
<<"\n\n2. Rectangle"
<<"\n\n3. Sqaure"
<<"\n\n4. Circle"
<<"\n\n5. Parallelogram"
<<"\n\n6. Main Menu"
<<"\n\nEnter your choice -->\t";
cin>>o2;
switch(o2)
{
case 1: cout<<"\n\n";
line();
cout<<"\n\t\t\t\tTraingle\n\n";
line();
triangle();
break;
case 2: cout<<"\n\n";
line();
cout<<"\n\t\t\t\tRectangle\n\n";
line();
rectangle();
break;
case 3: cout<<"\n\n";
line();
cout<<"\n\t\t\t\tSquare\n\n";
line();
square();
break;
case 4: cout<<"\n\n";
line();
cout<<"\n\t\t\t\tCircle\n\n";
line();
circle();
break;
case 5: cout<<"\n\n";
line();
cout<<"\n\t\t\t\tParallelogram\n\n";
line();
parallelogram();
break;
case 6: break;
default: cout<<"\n\nInvalid Input\a\a\a";
}
break;
case 3: cout<<"\n\nPress any key to exit...\a";
break;
default: cout<<"\n\nInvalid Input\a\a\a\a";
}
}while(o1!=3);
return 0;
}
void line()
{
int i;
for (i=0;i<80;i++)
cout<<"*";
}
void cuboid()
{
float l,b,h,a,v;
cout<<"\n\nEnter length of cuboid -->\t";
cin>>l;
cout<<"\n\nEnter breadth of cuboid -->\t";
cin>>b;
cout<<"\n\nEnter height of cuboid -->\t";
cin>>h;
v=l*b*h;
a=2*(l*b+b*h+l*h);
cout<<"\n\nVolume of cuboid is "<<v;
cout<<"\n\nSurface area of cuboid is "<<a;
}
void cube()
{
float l,a,v;
cout<<"\n\nEnter length of side of cube -->\t";
cin>>l;
v=l*l*l;
a=6*l*l;
cout<<"\n\nVolume of cube is "<<v;
cout<<"\n\nSurface area of cube is "<<a;
}
void cylinder()
{
float r,h,v,c,t;
cout<<"\n\nEnter radius of cylinder -->\t";
cin>>r;
cout<<"\n\nEnter height of cylinder -->\t";
cin>>h;
v=3.14*r*r*h;
c=2*3.14*r*h;
t=3.14*r*(2*h+r);
cout<<"\n\nVolume of cylinder is "<<v;
cout<<"\n\nCurved Surface Area of cylinder is "<<c;
cout<<"\n\nTotal Surface Area of cylinder is "<<t;
}
void cone()
{
float r,h,l,v,c,t;
cout<<"\n\nEnter radius of cone -->\t";
cin>>r;
cout<<"\n\nEnter height of cone -->\t";
cin>>h;
l=sqrt(r*r+h*h);
v=(3.14*r*r*h)/3;
c=3.14*r*l;
t=3.14*r*(l+r);
cout<<"\n\nSlant height of cone is "<<l;
cout<<"\n\nVolume of cone is "<<v;
cout<<"\n\nCurved Surface Area of cone is "<<c;
cout<<"\n\nTotal Surface Area of cone is "<<t;
}
void sphere()
{
float r,v,a;
cout<<"\n\nEnter radius of sphere -->\t";
cin>>r;
v=(4*3.14*r*r*r)/3;
a=4+3.14*r*r;
cout<<"\n\nVolume of sphere is "<<v;
cout<<"\n\nSurface Area of sphere is "<<a;
}
void hemisphere()
{
float r,v,c,t;
cout<<"\n\nEnter radius of hemisphere -->\t";
cin>>r;
v=(2*3.14*r*r*r)/3;
c=2*3.14*r*r;
t=3*3.14*r*r;
cout<<"\n\nVolume of hemisphere is "<<v;
cout<<"\n\nCurved Surface Area of hemisphere is "<<c;
cout<<"\n\nTotal Surface Area of hemisphere is "<<t;
}
void triangle()
{
float b,h,a;
cout<<"\n\nEnter base of triangle -->\t";
cin>>b;
cout<<"\n\nEnter height of triangle -->\t";
cin>>h;
a=(b*h)/2;
cout<<"\n\nArea of the triangle is "<<a;
}
void rectangle()
{
float l,b,a,p;
cout<<"\n\nEnter length of rectangle -->\t";
cin>>l;
cout<<"\n\nEnter breadth of rectangle -->\t";
cin>>b;
a=l*b;
p=2*(l+b);
cout<<"\n\nArea of rectangle is "<<a;
cout<<"\n\nPerimeter of rectangle is "<<p;
}
void square()
{
float s,a,p;
cout<<"\n\nEnter length of side of square -->\t";
cin>>s;
a=s*s;
p=4*s;
cout<<"\n\nArea of square is "<<a;
cout<<"\n\nPerimeter of square is "<<p;
}
void circle()
{
float r,a,c;
cout<<"\n\nEnter radius of circle -->\t";
cin>>r;
a=3.14*r*r;
c=2*3.14*r;
cout<<"\n\nArea of circle is "<<a;
cout<<"\n\nCircumference of circle is "<<c;
}
void parallelogram()
{
float b,h,a,p;
cout<<"\n\nEnter base of parallelogram -->\t";
cin>>b;
cout<<"\n\nEnter height of parallelogram -->\t";
cin>>h;
a=b*h;
p=2*(b+h);
cout<<"\n\nArea of parallelogram is "<<a;
cout<<"\n\nPerimeter of parallelogram is "<<p;
}
__________________
Harsh J www.harshj.com |
|
|
|
|
|
#10 (permalink) |
|
Dreamweaver
Join Date: Aug 2006
Location: Bangalore
Posts: 3,885
|
Guys... is my program rite now?
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore Follow me on twitter.com/gigacore |
|
|
|
|
#11 (permalink) | |
|
The Lord of Death
Join Date: May 2005
Location: यमलोक
Posts: 253
|
Quote:
Code:
#include <stdio.h>
int main(void)
{
int a = 0,
b = 0,
c = 0,
greatest = 0;
printf("Enter three numbers:\n");
scanf("%d %d %d", &a, &b, &c);
greatest = a;
if(b > greatest)
greatest = b;
if(c > greatest)
greatest = c;
printf("greatest of %d, %d and %d = %d", a, b, c, greatest);
return 0;
}
|
|
|
|
|
|
#13 (permalink) |
|
damn busy...
Join Date: Sep 2006
Location: Jhansi/Meerut
Posts: 1,973
|
this is a program in which u will hav 2 enter any 5 nos between 1 to 49 and if the number matches with the numbers chosen by the computer, u will win the lottery
#include <cstdlib> #include <iostream> using namespace std; void lotto(); void calc(int * a, int * b); void menu(); // Main function. Seeds random function // and calls menu function. int main() { srand((unsigned)time(0)); // Seed the random function...... menu(); } // This function prompts the user to pic // k five numbers between 1 and 49. // The function makes sure that the user // picks numbers between 1 and 49, // and that the user does not choose dup // licate numbers. Then the computer // chooses five random numbers. Error co // ntrol is used to check if the // computer chooses the same number twic // e. Then the numbers are displayed // to the screen. Finally the calc funct // ion is called to calculate and // output the results of the game... void lotto() { int i, k, j, b, x, y;// variables for all the for loops.... int s, t, user_error; int user[5], comp[5];// arrays for user and computers numbers.... int user_error_check, comp_error_check; // to find if numbers are duplicates.... // Prompt user to choose numbers cout << "Please choose five numbers from 0 to 49" << endl; for (i=0; i<5; i++) { cout << "Enter number " << i + 1 << ":" ; cin >> user[i]; if (user[i] > 49 || user[i] < 0) { cout << "You did not enter a number from 0 to 49" << endl; i--; } } // ERROR CONTROL, to make sure that the // user does not choose the // same number twice................. for(s=0; s<5; s++) for(t=0; t<s; t++) { user_error_check = user[s]; if(user_error_check == user[t]) { cout << "You have chosen duplicate numbers, please choose another number: " << endl; cin >> user_error; user[s] = user_error; } } // Now the computer chooses numbers..... // ........ for (k=0; k<5; k++) { comp[k] = (rand( ) % 49) + 1; // get comp to randomly generate 1 -49 } // ERROR CONTROL, to make sure that the // computer does not pick // the same number twice....... for(x=0; x<5; x++) for(y=0; y<x; y++) { comp_error_check = comp[x]; if (comp_error_check == comp[y]) { comp[x] = (rand() % 49) + 1; } } // no guarentee that the computer will not choose another number // already in the array, but it's the be // st i can do????? cout << "You chose: " ;// output users numbers... for (j=0; j<5; j++) { cout << user[j] << ", " ; } cout << endl; cout << "The computer chose: "; // output computers numbers... for (b=0; b<5; b++) { cout << comp[b] << ", " ; } cout << endl << endl; calc(user, comp);// Obtain the results of the game...... } // This function compares the computers // random numbers to the numbers // chosen by the user and lets the user // know how many (if any) they // have matched.............. void calc(int * a, int * b) { int i, k, match =0; for (i=0; i<5; i++) for (k=0; k<5; k++) if ( a[i] == b[k] ) { match += 1; cout << "You have matched: " << a[i] << endl; } if (match == 0) { cout << "Sorry you have not matched any of the computers numbers..." << endl << endl; } if (match == 5) { cout << "CONGRATULATIONS, YOU HAVE WON THE LOTTERY!!!!!!!" << endl << endl; } } // This function informs the user how to // play the game and then allows // the user to play the game until they // enter 'q' or 'Q' at the prompt. void menu() { char choice; cout << endl; cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$" << endl; cout << "$(C)$" << endl; cout << "$ $" << endl; cout << "$ *The computer will randomly choose five numbers $" << endl; cout << "$ between 1 and 49.$" << endl; cout << "$ $" << endl; cout << "$ *You can choose five numbers and try to match$" << endl; cout << "$ the computers numbers...... $" << endl; cout << "$ $" << endl; cout << "$ **Do not pick the same number twice or pick a$" << endl; cout << "$number less than 1 or greater than 49, o.k.?$" << endl; cout << "$ $" << endl; cout << "$ $" << endl; cout << "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$" << endl; cout << endl; while (choice != 'q' || choice != 'Q') { cout << "Make a selection from the menu: " << endl; cout << "[P]- Play the clotto against the computer." << endl; cout << "[Q]- Exit this program." << endl; cin >> choice; switch(choice) { case 'p': case 'P': lotto(); break; case 'q': case 'Q': cout << "No lotto for you!" << endl; exit(0); break; } } }
__________________
MSI GX660 with ATI 5870 Dell Studio 15(1555) 1TB+1.5TB external|N86|ZTE Blade|5230|E63|EP-630|Soundmagic PL50|Sennheiser CXL 400|Meelec M11P+ www.techjunkiez.com |
|
|
|
|
#14 (permalink) |
|
The Sexy Beast
Join Date: Feb 2006
Location: Mumbai
Posts: 610
|
^^this is totally wrong what if b>c>gr8test there's no condition to test that
use this thread to request programs and then pm to the requester rather than posting so much code over here it really looks a mess and these are quite basic too |
|
|
|
|
#15 (permalink) |
|
Dreamweaver
Join Date: Aug 2006
Location: Bangalore
Posts: 3,885
|
@ utsav... did it execute buddy?
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore Follow me on twitter.com/gigacore |
|
|
|
|
#16 (permalink) | |
|
The Lord of Death
Join Date: May 2005
Location: यमलोक
Posts: 253
|
Quote:
1. Read the fscking code. And mine is pretty readable. 2. Test it before complaining. 3. If you still don't get it, it's time to buy a decent C book. |
|
|
|
|
|
#17 (permalink) |
|
NP : Crysis
Join Date: Mar 2007
Location: City 17
Posts: 1,415
|
@yamraj : what was wrong with my prog??
__________________
Gaming: Phenom II x4 965BE @ 3.6Ghz/Corsair H50 Liquid Cooling/MSI 790FX-GD70/2x2GB GSkill Ripjaws 7-7-7-24/3 x GTX 470 w/Zalman VF3000F/Corsair 850W PSU/Antec 1200/2xSpinpoint F3 500Gb RAID 0 |
|
|
|
|
#18 (permalink) | |
|
The Lord of Death
Join Date: May 2005
Location: यमलोक
Posts: 253
|
Quote:
I recommend a decent and recent C++ book, like C++: How To Program, C++ Primer, 4th/e or C++ Primer Plus. |
|
|
|
|
|
#19 (permalink) |
|
damn busy...
Join Date: Sep 2006
Location: Jhansi/Meerut
Posts: 1,973
|
@ gigacore it executed nicely on devc++. tell me the problm with my program
__________________
MSI GX660 with ATI 5870 Dell Studio 15(1555) 1TB+1.5TB external|N86|ZTE Blade|5230|E63|EP-630|Soundmagic PL50|Sennheiser CXL 400|Meelec M11P+ www.techjunkiez.com |
|
|
|
|
#20 (permalink) |
|
I see right through you.
Join Date: Sep 2005
Location: Chennai
Posts: 597
|
And for heaven's sake indent the code like the first post. It's unreadable otherwise.
__________________
I didn't make the world, I only try to live in it. http://lucentbeing.com -- Sykora -- |
|
|
|
|
#21 (permalink) | |
|
Dreamweaver
Join Date: Aug 2006
Location: Bangalore
Posts: 3,885
|
Program To Reverse a Number
Quote:
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore Follow me on twitter.com/gigacore Last edited by Gigacore; 02-09-2007 at 08:59 PM. |
|
|
|
|
|
#23 (permalink) |
|
damn busy...
Join Date: Sep 2006
Location: Jhansi/Meerut
Posts: 1,973
|
^^ i hav used comments in my program
__________________
MSI GX660 with ATI 5870 Dell Studio 15(1555) 1TB+1.5TB external|N86|ZTE Blade|5230|E63|EP-630|Soundmagic PL50|Sennheiser CXL 400|Meelec M11P+ www.techjunkiez.com |
|
|
|
|
#25 (permalink) | ||
|
Pee into the Wind...
Join Date: May 2007
Location: Mumbai
Posts: 782
|
Quote:
can someone tell me what's wrong in this program.Using Dev C++ Quote:
__________________
Life is as complicated as you say it is. |
||
|
|
|
|
#27 (permalink) | |
|
NP : Crysis
Join Date: Mar 2007
Location: City 17
Posts: 1,415
|
Quote:
__________________
Gaming: Phenom II x4 965BE @ 3.6Ghz/Corsair H50 Liquid Cooling/MSI 790FX-GD70/2x2GB GSkill Ripjaws 7-7-7-24/3 x GTX 470 w/Zalman VF3000F/Corsair 850W PSU/Antec 1200/2xSpinpoint F3 500Gb RAID 0 |
|
|
|
|
|
#28 (permalink) | |
|
Pee into the Wind...
Join Date: May 2007
Location: Mumbai
Posts: 782
|
Quote:
__________________
Life is as complicated as you say it is. |
|
|
|
|
|
#29 (permalink) |
|
I see right through you.
Join Date: Sep 2005
Location: Chennai
Posts: 597
|
@shady_inc :
conio.h is non-standard. Your calsum() doesn't have a forward declaration. Put main() after calsum() or put the line : Code:
int calsum(float, float);
__________________
I didn't make the world, I only try to live in it. http://lucentbeing.com -- Sykora -- |
|
|
|
|
#30 (permalink) |
|
Dreamweaver
Join Date: Aug 2006
Location: Bangalore
Posts: 3,885
|
does any know how to write this one?
Write a program using functions to find whether the given number is a prime number?
__________________
Today's noobs are tomorrow's geeks. Don't make fun of them.. encourage them. - Gigacore Follow me on twitter.com/gigacore |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.thinkdigit.com/forum/programming/67133-post-your-c-c-programs-here.html
|
||||
| Posted By | For | Type | Date | |
| Post ur C C Programs Here Programming Question | Post #0 | Refback | 15-04-2011 07:41 AM | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Uninstall programs, not listed in add/remove programs | Aanand | QnA (read only) | 9 | 06-06-2008 07:00 PM |
| Deathly Hallows Released : Post Comments (Don't post Spoilers) | Quiz_Master | Chit-Chat | 142 | 31-07-2007 10:49 PM |
| Make a folder in "start>programs" menu & move programs to it | Aanand | QnA (read only) | 5 | 26-10-2005 12:25 AM |