0 Reputation Points
0% Quality Score
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
2 Posted Topics
Re: To solve the problem you can use "ctime" library and the function srand(). #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int i, r; srand(time(0)); for(i = 0; r <= 20000; i++) r = rand(); cout << "Number is " << r << ". It was … | |
Re: Hello! This worked for me! #include <iostream> using namespace std; int IsPalindrome(char*); void main() { char word[25]; cout <<" Enter a word: "; cin>> word; if (IsPalindrome(word)) cout<<" Is a palindrome "; else cout<<" Is not a palindrome " <<"\n"; system("pause"); } int IsPalindrome(char* str1) { int i,counter=0; for(i=0; str1[i]!='\0'; … |
The End.