Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
How to write a function template
A function template should be written at the beginning of the program in the global area, or you may place it into a header file. All function templates begin with a template declaration.
The syntax is :
1. the keyword class ( this usage of class has nothing to do with the key word class used to make user-defined type.)
2. a variable that shows some generic type, and will be used whenever this type requires to be written in the function definition. Typically the name T is used, but any valid C++ name will do.
e.g.
template < class T>
T max(char x, char y)
{
return ( x > y) ? x : y ;
}
void main()
cout << max( 1,2) << endl;
cout << max( 5.62,3.48) << endl;
cout << max('A','a') << endl;
cout << max( 4,3) << endl;
The output is :
2
5.62
a
6
Write a program to calculate e^x using the formula: e^x = 1 + x/1! + x^2/2! + x^3/3! + ...... Allow the user to enter the integer number x, then do the calculation in a loop (for
Define the Recursion Function in C? In C, it is potential for the function to call themselves a function is describing 'recursive' if a statement within the body of a function
Using the Constructor There are basically three ways of creating and initializing the object. The first way to call the constructor is explicitly as :
Explain about the Character Constants in c language? The character constant is a single alphabet and a single digit or a single special symbol enclosed within a pair of single
write a c program to solve exanple of lamis therom
#include using namespace std; void print(int marks_arr[],int cnt) { int ind[cnt]; int i=0; int j=0; int k=0; int s=0; for(k=0;k { ind[k]=0; } int cnt1=0; for(i=0;i
C program to reverse the elements of array: #define rows 3 #define cols 3 void main() { int i=0,j=0; int arr[rows][cols];
The size of () operator This is a pseudo-operator given by the language, which returns the number of bytes taken up by a variable or data type. The value returned by this opera
A body which has three forces acting on it is in equilibrium. One force is 3N to the North and the other is 4N to the west. What us the magnitude and direction of the third force?
what is logic in C
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd