skip to main
|
skip to sidebar
C++ Programs
Based on cusat cs 3rd sem 2009 lab cycle
Friday, May 14, 2010
Inline function
7. Write a inline function to compute the distance between 2 cordinates
#include<iostream.h> #include<conio.h> #include<math.h> inline float dist(int a,int b,int c,int d) { return(sqrt((a-c)*(a-c)+(b-d)*(b-d))); } void main() { clrscr(); int x1,x2,y1,y2; cout<<"Enter the first cordinate "; cin>>x1>>y1; cout<<"Enter the second cordinate "; cin>>x2>>y2; float f=dist(x1,y1,x2,y2); cout<<"\nDistance= "<<f; getch(); }
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Home
8085 programming
Datastructure
Graphics programming
8086 Programming
LEX, YACC and parsers
Operating System
Programzz!
Add two date using operator overloading
Add two date using class
Decrement time by one using operator overloading(E...
Add two time using operator overloading(External q...
Compare two string. use operator overloading(Exter...
Matrix multiplcation(External Questn-2009)
Difference between two dates
Generic programming
File manipulation
Pure Virtual Function
Virtual Function
Multipath Inheritance
Hybrid Inheritance
Hierarchical inheritance
Addition of two distances using friend function
Class to class conversion
Basic to class and class to basic conversion
Operator functions as friend functions
Function overloading.
Static & Constant function
User defined string functions
Complex numbers using operator overloading.
Inline function
Add two time
Differnt temprature scale(Farenheit/celsius/kelvin).
Students details- using class
Students details- using structure
Check whether a date is valid or not
pass by value, pass by address, pass by refrence
Followers
Blog Archive
▼
2010
(29)
►
December
(2)
►
October
(4)
►
July
(1)
▼
May
(22)
Generic programming
File manipulation
Pure Virtual Function
Virtual Function
Multipath Inheritance
Hybrid Inheritance
Hierarchical inheritance
Addition of two distances using friend function
Class to class conversion
Basic to class and class to basic conversion
Operator functions as friend functions
Function overloading.
Static & Constant function
User defined string functions
Complex numbers using operator overloading.
Inline function
Add two time
Differnt temprature scale(Farenheit/celsius/kelvin).
Students details- using class
Students details- using structure
Check whether a date is valid or not
pass by value, pass by address, pass by refrence
About Me
Arun Ramesh
View my complete profile
No comments:
Post a Comment