Skip to content

Instantly share code, notes, and snippets.

@Fatima-progmmer
Created February 4, 2025 08:25
Show Gist options
  • Save Fatima-progmmer/3adc9fde2c2bc95244d2c616479c2cdb to your computer and use it in GitHub Desktop.
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
#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