Uploaded by Mohammad Naimat

c++ exam

advertisement
1. This code for swap numbers, find the error then
fix it.
#include <iostream>
using namespace std;
int main()
{
int a = 5, b = 10, temp;
cout << "Before swapping." << endl;
cout << "a = " << a << ", b = " << b << endl;
temp = c;
a = b;
b = a;
cout << "\nAfter swapping." endl;
cout << "a = " << a << ", b = " << b << endl;
return 0;
}
2. Write a program to find Factorial of a given
number
Download