#include <iostream>
#include <cmath>
usingnamespace std;
int main() {
longlongint x;
x = 0;
while(x<=0) {
cout << "Enter an integer greater than 0." << endl;
cin >> x;
}
for(int k=2; k<(sqrt((double)x)); k++){
if(x % k == 0) {
x = x/k;
}
}
int count = 0;
int temp = 0;
int largestprime = 0;
for(longlongint i=(x/2); i>0; i--){
if(x % i== 0) {
count = 0;
for(longlongint j=(i/2); j>0; j--){
if(i % j== 0) {
count++;
}
}
if(count == 1 && largestprime == 0) largestprime= i;
}
}
if (largestprime != 0) {
cout << largestprime << " is the largest prime multiple of " << x << endl;;
}
else {
cout << x << " is a prime number." << endl;
}
system("PAUSE");
return 0;
}

here is my finished program. it works right and fast.
I changed it by looking for the lowest factor at first and then dividing the big number by it. This cut it down to smaller size.

if for example the user inputs a letter at first instead of a number, my program farts. I don't know how to control user input yet.

You are solving a specific problem. You should only train your brain/learn some ways of solving specific problem. Your program shouldn't be The Best Program In The World; it just should do its job.

However, if you really do want to reuse this code later - your problem is that you take int as an input:

1 2 3

longlongint x;
//code here
cin >> x;

This way, if someone write text string - program will break. If you want to fix it, I suggest using sstream, although I think this is really unnecessary here, as we want program to work fast and we know what input should be.

PS. Oh, and one thing: Try to avoid system("PAUSE");