This program works only on Microsoft compiler, people who are using another compilers will have to modify pointer initialization to
double vfirstNumber = 0.0;
double* firstNumber = &vfirstVariable;
...
double vsecondNumber = 0.0;
double* secondNumber = &vsecondNumber;
Or whatever you find is better.
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main()
{
double* firstNumber = NULL;
cout << endl << "Enter first number: ";
cin >> *firstNumber;
double* secondNumber = NULL;
cout << endl << "Enter second number: ";
cin >> *secondNumber;
if (*firstNumber > *secondNumber)
{
cout << endl << *firstNumber << " > " << *secondNumber << endl;
}
else if (*firstNumber < *secondNumber)
{
cout << endl << *firstNumber << " < " << *secondNumber << endl;
}
else
{
cout << endl << *firstNumber << " = " << *secondNumber << endl;
}
system("PAUSE");
return 0;
}
To write a C++ program to display the student details using class and array of object.
12
write a vb program to find the magic square
You can make use of pointers to achieve this.void add( int *a, int *b){(*a) += (*b);}Now if two numbers a and b are given and you need to store the value in variable c, then you would perform:c = a;add(&c,&b);
Write and run a client and a server program in C-language using UDP
program to find maximum of two numbers using pointers
i cant write
sorry
nahi malum
write an assembly language program to find sum of N numbers
mystrcpy (char* dest, char* src) { while ((*dest++ = *src++) != '\0); }
To write a C++ program to display the student details using class and array of object.
yes
i need this answer
12
pro c language to implement linear search using pointers
void main() { int n=0,i,*p; clrscr(); printf("enter the value of n"); scanf("%d",&n); p=&n; for(i=0;i<=n;i++) { *p=*p+i; } printf("value of the sum is %d",*p); getch(); }