#include
using namespace std;
struct node
{
int data;
node*next;
}*head;
int main()
{
int n;
char ch;
do
{
cout<<"\n"<<“menu driven program”;
cout<<"\n"<<“1.create node”;
cout<<"\n"<<“2.print node”;
cout<<"\n"<<“enter your choice”;
cin>>n;
switch(n)
{
case 1:
{
int y;
cout<<"enter the roll no";
cin>>y;
node*temp=new node;
temp->data=y;
if(head=NULL)
{
head=temp;
}
else
{
temp->next=head;
head=temp;
}
}
case 2:
{
node*temp=head;
while(head!=NULL)
{
cout<<temp->data;
temp=temp->next;
}
}
}
cout<<"\n"<<“do want to continue”;
cin>>ch;
}while(ch==‘y’);
}
THE code is executing but not giving ther desired output.
please help