#include
#include
#include
struct linkedlist
{
int data;
struct linkedlist *next;
};
typedef struct linkedlist node;
void main()
{
int count=0;
node *head,*ptr,*new1;
char ch;
clrscr();
head=(node *)malloc(sizeof(node));
ptr=head;
do
{
printf("\nEnter the data\n");
scanf("%d",&ptr->data);
count++;
printf("Do you want to continue(y/n):");
ch=getch();
if(ch=='y')
{
clrscr();
ptr->next=(node *)malloc(sizeof(node));
ptr->next=new1;
ptr=ptr->next;
}
else
ptr->next=NULL;
}
while(ch!='n');

printf("\nno of nodes inthe list %d",count);
getch();
}


#include
#include
#include
struct linkedlist
{
int data;
struct linkedlist *next;
};
typedef struct linkedlist node;
void main()
{
node *head,*ptr,*new1;
char ch;
int large;
clrscr();
head=(node *)malloc(sizeof(node));
ptr=head;
do
{
printf("\nEnter the data \n");
scanf("%d",&ptr->data);
printf("\nDo you want to continue(y/n):");
ch=getch();
if(ch=='y')
{
clrscr();
ptr->next=(node *)malloc(sizeof(node));
ptr->next=new1;
ptr=ptr->next;
}
else
ptr->next=NULL;
}
while(ch!='n');
ptr=head;
large=ptr->data;
// printf("\nLinklist elements are:\n");
while(ptr!=NULL)
{
ptr=ptr->next;
if(ptr->data>large)
large=ptr->data;
}
printf("\nLargest Number in linked list= %d\t",large);
getch();
}
#include
#include
char x;
int pin, repeat, menu;
int withdraw, deposit, transfer, amount;
main()


{ clrscr();
gotoxy(20,1);printf(":--------------------------------------:\n");
gotoxy(20,2);printf(": Welcome to ATM Banking System:\n");
gotoxy(20,3);printf(": Created by:\n");
gotoxy(20,4);printf(": ivan john Navasca:\n");
gotoxy(20,5);printf(": :\n");
gotoxy(20,6);printf(": Enter your PIN -->:\n");
gotoxy(20,7);printf(":--------------------------------------:\n");
gotoxy(40,6);
scanf(" %d",&pin);
if (pin==1234)
{printf("access granted");}
else
{exit();}
Loop:


{clrscr();
printf(":-------------------------------------------:\n");
printf(": Choose your Transaction :\n");
printf("::\n");
printf(": 1 Inquiry Balance :\n");
printf(": 2 Withdraw:\n");
printf(": 3 Deposit :\n");
printf(": 4 Transfer Fund:\n");
printf(": 5 Exit:\n");
printf(": -->:\n");
printf(":-------------------------------------------:\n");
gotoxy(6,9);
scanf(" %d",&menu);
printf("\n\n");
switch(menu)


{
case 1:{printf("Your balance %d\n\n",amount);
printf("Another transaction? y or n?: ");
scanf(" %c",&x);
if((x == 'y')||(x== 'Y'))


{
goto Loop;
}
else if((x =='n')||(x== 'N'))


{
printf("\nThank You for Banking");
getch();
exit();
}
break;}
case 2:{if(amount==0)
{printf("You have an Isuficient Fund\nPress Enter");
getch();
goto Loop;
}
else

{
printf("Your Balance %d\n\n",amount);
printf("Enter Amount to Withdraw: ");
scanf("%d",&withdraw);
amount = amount - withdraw;
printf("\nYour Current Balance %d\n\n",amount);
printf("Another Transaction? y or n : ");
scanf(" %c",&x);
if((x =='y')||(x=='Y'))


{
goto Loop;
}
else if ((x =='n')||(x=='N'))


{
printf("\nThank You for Banking");
getch();
exit();
} }
break;}
case 3:{printf("Your Balance %d\n",amount);
printf("\nEnter Amount to Deposit: ");
scanf("%d",&deposit);
amount= amount + deposit;
printf("\nYour Current Balance %d\n",amount);
printf("Another Transaction? y or n: ");
scanf(" %c",&x);
if ((x =='y')||(x=='Y'))


{
goto Loop;
}
else if ((x =='n')||(x=='N'))


{
printf("\n\nThank You for Banking");
getch();
exit();
}
break;}
case 4:{printf("Your Balance %d\n",amount);
printf("\nEnter Amount to Transfer: ");
scanf(" %d",&transfer);
amount = amount - transfer;
printf("\nYour Current Balance %d",amount);
printf("\n\nAnother Transaction? y or n: ");
scanf(" %c",&x);
if ((x =='y')||(x=='Y'))


{
goto Loop;
}
else if ((x =='n')||(x=='N'))


{
printf("Thank You for Banking");
getch();
exit();
}
break;}
case 5:{printf("You Want to Exit? y or n: ");
scanf(" %c",&x);
if ((x=='y')||(x=='Y'))


{
printf("\n\nThank You & Come Again");
getch();
exit();
}
else if ((x =='n')||(x=='N'))


{
goto Loop;
}
break;}
default:
exit();
}
}

while(repeat);
getch();
}
#include

main ()
{
int number, last_digit, first_digit, total;
printf ("Enter the number which is to be Work out: ");

scanf ("%d", &number);


last_digit = number % 10;

total = last_digit;

first_digit = (number / 1000) % 10;

total = total + first_digit;

printf ("The total of the first and the last digit of the entered number is: %d", total);

}

CSS Menu Samples