#include <bits/stdc++.h>
using namespace std;
struct node
{
int num;
node *next;
}*st; //node constructed
void createList(int n);
void reverse(node *st);

int main()
{
int n,num,item;

cout<<"Enter the number of nodes: ";
cin>>n;
createList(n);
cout<<"After reversing :\n";
reverse(st);
return 0;
}
void createList(int n) //function to create linked list.
{…

Mainak Debnath

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store