diff --git a/C++/palindrome.cpp b/C++/palindrome.cpp new file mode 100644 index 00000000..64841a3f --- /dev/null +++ b/C++/palindrome.cpp @@ -0,0 +1,28 @@ +#include +using namespace std; + +int main() +{ + int n, num, digit, rev = 0; + + cout << "Enter a positive number: "; + cin >> num; + + n = num; + + do + { + digit = num % 10; + rev = (rev * 10) + digit; + num = num / 10; + } while (num != 0); + + cout << " The reverse of the number is: " << rev << endl; + + if (n == rev) + cout << " The number is a palindrome."; + else + cout << " The number is not a palindrome."; + + return 0; +} diff --git a/C/factorial.c b/C/factorial.c new file mode 100644 index 00000000..1663258b --- /dev/null +++ b/C/factorial.c @@ -0,0 +1,12 @@ +#include +int main() +{ + int i,fact=1,number; + printf("Enter a number: "); + scanf("%d",&number); + for(i=1;i<=number;i++){ + fact=fact*i; + } + printf("Factorial of %d is: %d",number,fact); +return 0; +} diff --git a/Contributors.md b/Contributors.md index 272a6a58..3a800670 100644 --- a/Contributors.md +++ b/Contributors.md @@ -117,5 +117,8 @@ Name: [Muhammad Iqbal R](https://github.com/miqbalrr)
Place: Indonesia
About: BACKEND Developer
+Name: [Murshida](https://github.com/murshida223)
+Place: india
+About: plus two student