Created
February 4, 2025 08:25
-
-
Save Fatima-progmmer/3adc9fde2c2bc95244d2c616479c2cdb to your computer and use it in GitHub Desktop.
This program show to how to get input from the user and return them in reversing oreder without using any function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
void reverse(char str[],int num) | |
{ | |
cout << "\nAfter reversing\n"; | |
for (int i = num; i >= 1; i--) | |
cout << str[i] << " \t\t"; | |
} | |
int main() | |
{ | |
int num; | |
char str[num]; | |
cout << "How many characters you want to enter ?;" << endl; | |
cin >> num; | |
cout << "\t Enter characters" << endl; | |
for (int i = 1; i <= num; i++) | |
cin >> str[i]; | |
reverse(str,num); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment