Tuesday 11 June 2013

Project- Supper Market Billing

Project- Supper Market Billing
#include<iostream>
#include<windows.h>
#include<conio.h>
#include<fstream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<iomanip>
using namespace std;
//global variable declaration
int k=7,r=0,flag=0;
COORD coord = {0, 0};

void gotoxy(int x, int y)
{
 COORD coord;
 coord.X = x;
 coord.Y = y;
 SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
struct date
{int mm,dd,yy;};

ofstream fout;
ifstream fin;

class item
{
int itemno;
char name[25];
date d;
public:
void add()
{
cout<<"\n\n\tItem No: ";
cin>>itemno;
cout<<"\n\n\tName of the item: ";
cin>>name;
//gets(name);
cout<<"\n\n\tManufacturing Date(dd-mm-yy): ";
cin>>d.mm>>d.dd>>d.yy;
}
void show()
{
cout<<"\n\tItem No: ";
cout<<itemno;
cout<<"\n\n\tName of the item: ";
cout<<name;
cout<<"\n\n\tDate : ";
cout<<d.mm<<"-"<<d.dd<<"-"<<d.yy;
}
void report()
{
gotoxy(3,k);
cout<<itemno;
gotoxy(13,k);
puts(name);
}
int retno()
{
    return(itemno);

}

};

class amount: public item
{
float price,qty,tax,gross,dis,netamt;
public:
void add();
void show();
void report();
void calculate();
void pay();
float retnetamt()
{
    return(netamt);
}
}amt;

void amount::add()
{
item::add();
cout<<"\n\n\tPrice: ";
cin>>price;
cout<<"\n\n\tQuantity: ";
cin>>qty;
cout<<"\n\n\tTax percent: ";
cin>>tax;
cout<<"\n\n\tDiscount percent: ";
cin>>dis;
calculate();
fout.write((char *)&amt,sizeof(amt));
fout.close();
}
void amount::calculate()
{gross=price+(price*(tax/100));
netamt=qty*(gross-(gross*(dis/100)));
}
void amount::show()
{fin.open("itemstore.dat",ios::binary);
fin.read((char*)&amt,sizeof(amt));
item::show();
cout<<"\n\n\tNet amount: ";
cout<<netamt;
fin.close();
}

void amount::report()
{item::report();
gotoxy(23,k);
cout<<price;
gotoxy(33,k);
cout<<qty;
gotoxy(44,k);
cout<<tax;
gotoxy(52,k);
cout<<dis;
gotoxy(64,k);
cout<<netamt;
k=k+1;
if(k==50)
{gotoxy(25,50);
cout<<"PRESS ANY KEY TO CONTINUE...";
getch();
k=7;
system("cls");
gotoxy(30,3);
cout<<" ITEM DETAILS ";
gotoxy(3,5);
cout<<"NUMBER";
gotoxy(13,5);
cout<<"NAME";
gotoxy(23,5);
cout<<"PRICE";
gotoxy(33,5);
cout<<"QUANTITY";
gotoxy(44,5);
cout<<"TAX";
gotoxy(52,5);
cout<<"DEDUCTION";
gotoxy(64,5);
cout<<"NET AMOUNT";
}
}

void amount::pay()
{show();
cout<<"\n\n\n\t\t*********************************************";
cout<<"\n\t\t                 DETAILS                  ";
cout<<"\n\t\t*********************************************";
cout<<"\n\n\t\tPRICE                     :"<<price;
cout<<"\n\n\t\tQUANTITY                  :"<<qty;
cout<<"\n\t\tTAX PERCENTAGE              :"<<tax;
cout<<"\n\t\tDISCOUNT PERCENTAGE         :"<<dis;
cout<<"\n\n\n\t\tNET AMOUNT              :Rs."<<netamt;
cout<<"\n\t\t*********************************************";
}

int main()
{
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout<<setprecision(2);
fstream tmp("temp.dat",ios::binary|ios::out);
menu:
system("cls");
gotoxy(25,2);
cout<<"Super Market Billing ";
gotoxy(25,3);
cout<<"===========================\n\n";
cout<<"\n\t\t1.Bill Report\n\n";
cout<<"\t\t2.Add/Remove/Edit Item\n\n";
cout<<"\t\t3.Show Item Details\n\n";
cout<<"\t\t4.Exit\n\n";
cout<<"\t\tPlease Enter Required Option: ";
int ch,ff;
float gtotal;
cin>>ch;
switch(ch)
{case 1:ss:
system("cls");
gotoxy(25,2);
cout<<"Bill Details";
gotoxy(25,3);
cout<<"================\n\n";
cout<<"\n\t\t1.All Items\n\n";
cout<<"\t\t2.Back to Main menu\n\n";
cout<<"\t\tPlease Enter Required Option: ";
int cho;
cin>>cho;
if(cho==1)
{system("cls");
gotoxy(30,3);
cout<<" BILL DETAILS ";
gotoxy(3,5);
cout<<"ITEM NO";
gotoxy(13,5);
cout<<"NAME";
gotoxy(23,5);
cout<<"PRICE";
gotoxy(33,5);
cout<<"QUANTITY";
gotoxy(44,5);
cout<<"TAX %";
gotoxy(52,5);
cout<<"DISCOUNT %";
gotoxy(64,5);
cout<<"NET AMOUNT";
fin.open("itemstore.dat",ios::binary);
if(!fin)
{cout<<"\n\nFile Not Found...";
goto menu;}
fin.seekg(0);
gtotal=0;
while(!fin.eof())
{fin.read((char*)&amt,sizeof(amt));
if(!fin.eof())
{amt.report();
gtotal+=amt.retnetamt();
ff=0;}
if(ff!=0) gtotal=0;
}gotoxy(17,k);
cout<<"\n\n\n\t\t\tGrand Total="<<gtotal;
getch();
fin.close();
}
if(cho==2)
{goto menu;}
goto ss;
case 2:
db:
system("cls");
gotoxy(25,2);
cout<<"Bill Editor";
gotoxy(25,3);
cout<<"=================\n\n";
cout<<"\n\t\t1.Add Item Details\n\n";
cout<<"\t\t2.Edit Item Details\n\n";
cout<<"\t\t3.Delete Item Details\n\n";
cout<<"\t\t4.Back to Main Menu ";
int apc;
cin>>apc;
switch(apc)
{
case 1:fout.open("itemstore.dat",ios::binary|ios::app);
amt.add();
cout<<"\n\t\tItem Added Successfully!";
getch();
goto db;

case 2:
int ino;
flag=0;
cout<<"\n\n\tEnter Item Number to be Edited :";
cin>>ino;
fin.open("itemstore.dat",ios::binary);
fout.open("itemstore.dat",ios::binary|ios::app);
if(!fin)
{cout<<"\n\nFile Not Found...";
goto menu;
}
fin.seekg(0);
r=0;
while(!fin.eof())
{fin.read((char*)&amt,sizeof(amt));
if(!fin.eof())
{int x=amt.item::retno();
if(x==ino)
{flag=1;
fout.seekp(r*sizeof(amt));
system("cls");
cout<<"\n\t\tCurrent Details are\n";
amt.show();
cout<<"\n\n\t\tEnter New Details\n";
amt.add();
cout<<"\n\t\tItem Details editted";
}
}r++;
}
if(flag==0)
{cout<<"\n\t\tItem No does not exist...Please Retry!";
getch();
goto db;
}
fin.close();
getch();
goto db;

case 3:flag=0;
cout<<"\n\n\tEnter Item Number to be deleted :";
cin>>ino;
fin.open("itemstore.dat",ios::binary);
if(!fin)
{cout<<"\n\nFile Not Found...";
goto menu;
}
//fstream tmp("temp.dat",ios::binary|ios::out);
fin.seekg(0);
while(fin.read((char*)&amt, sizeof(amt)))
{int x=amt.item::retno();
if(x!=ino)
tmp.write((char*)&amt,sizeof(amt));
else
{flag=1;}
}
fin.close();
tmp.close();
fout.open("itemstore.dat",ios::trunc|ios::binary);
fout.seekp(0);
tmp.open("temp.dat",ios::binary|ios::in);
if(!tmp)
{cout<<"Error in File";
goto db;
}
while(tmp.read((char*)&amt,sizeof(amt)))
fout.write((char*)&amt,sizeof(amt));
tmp.close();
fout.close();
if(flag==1)
cout<<"\n\t\tItem Succesfully Deleted";
else if (flag==0)
cout<<"\n\t\tItem does not Exist! Please Retry";
getch();
goto db;
case 4:
goto menu;
default: cout<<"\n\n\t\tWrong Choice!!! Retry";
getch();
goto db;
}
case 3:system("cls");
flag=0;
int ino;
cout<<"\n\n\t\tEnter Item Number :";
cin>>ino;
fin.open("itemstore.dat",ios::binary);
if(!fin)
{cout<<"\n\nFile Not Found...\nProgram Terminated!";
goto menu;
}
fin.seekg(0);
while(fin.read((char*)&amt,sizeof(amt)))
{int x=amt.item::retno();
if(x==ino)
{amt.pay();
flag=1;
break;
}
}
if(flag==0)
cout<<"\n\t\tItem does not exist....Please Retry!";
getch();
fin.close();
goto menu;
case 4:system("cls");
gotoxy(20,20);
cout<<"ARE YOU SURE, YOU WANT TO EXIT (Y/N)?";
char yn;
cin>>yn;
if((yn=='Y')||(yn=='y'))
{gotoxy(12,20);
system("cls");
cout<<"************************** THANKS **************************************";
getch();
exit(0);
}
else if((yn=='N')||(yn=='n'))
goto menu;
else{goto menu;}
default:cout<<"\n\n\t\tWrong Choice....Please Retry!";
getch();
goto menu;
}
return 0;
}

PASCALS TRIANGLE

PASCALS TRIANGLE

#include<stdio.h>
#include<conio.h>
int main() {

        int a[15][15], i, j, rows, num = 25, k;
        printf("----------------------------------------------------------------------\n");
        printf("------------------made by BEST BLOG for TECHNOLOGY LOVERS -----------------\n");
        printf("----------------------------------------------------------------------\n");
        printf("\n\n\t\t C PROGRAM OF PASCALS TRIANGLE \n");
        printf("\n Enter the number of rows you want to show : ");
        scanf("%d", &rows);
        printf("\n\n\n");
        for (i = 0; i < rows; i++) {
               for (k = num - 2 * i; k >= 0; k--)
                     printf(" ");
               for (j = 0; j <= i; j++) {
                     if (j == 0 || i == j) {
                         a[i][j] = 1;
                     } else {
                         a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
                     }
                     printf("%4d", a[i][j]);
               }
               printf("\n");
         }
         getch();
}

Saturday 8 June 2013

AMPLITUDE MODULATION


Depth First Search DFS

/*
 * File:   DFS.c
 * Author: SUVO
 * suvayan92@gmail.com
 * Created on 08 June, 2013, 03:34 PM
 */

#include <stdio.h>
#include <stdlib.h>
#define SIZE 100
#define debugMode 0 //for debugging purpose, set to 1 if want to start in debug mode

typedef enum{
    FALSE, TRUE
}boolean;

//////***********Implementation of Stack *****************///
//this stack can be used in DFS traversal of the graph.
typedef struct {
    char item[SIZE];
    int top;
}Stack;

void push(Stack *sp, char val){
    if (sp->top == SIZE-1){
        printf("\n:( Unable to process more than 100 elements\n Stack Overflow\nterminating process");
        return;
    }
    sp->item[++sp->top] = val;
}
char pop(Stack *sp){
    if (sp->top == -1){
        printf("Stack Underflow\n terminating the process\n");
        exit(0);
    }
    return sp->item[sp->top--];
}

/////****************END OF STACK IMPLEMENTATION***************************//
////*****************IMPLEMEMTATION OF QUEUE FOR BFS TRAVERSAL*****************/
typedef struct {
    char item[SIZE];
    int rear, front;
}Queue;

void queueInsert(Queue *qp, char val){
    if ((qp->rear+1)%SIZE==qp->rear){
        printf(":( Unusual situation, Queue overflow\nTerminating the process\n");
        exit(0);
    }
    qp->rear=(qp->rear+1)%SIZE;//moving the rear to the next location circularly.  
     //now place the value at the rear
    qp->item[qp->rear] = val;
}

char queueRetrieve(Queue *qp){
    if (qp->rear==qp->front){
        printf(":( Unusual situation\nQueue Underflow\nTerminating process\n");
        exit(0);
    }
    //move the front to the next location circularly
    qp->front = (qp->front+1)%SIZE;
    return qp->item[qp->front];
}

typedef struct GraphNode{
    char nodeVal;
    int STATUS;//used for BFS, DFS traversal
    //STATUS=0, node is un-touched, initial state.
    //STATUS=1, node is inserted into the STACK (BFS)/QUEUE (DFS)
    //STATUS=2, node has been processed;
    struct GraphNode *next;  
}GraphNode;

typedef struct AdjList{
     GraphNode *adjListHead;
     int nodeCount;
     int edgeCount;
}AdjList;

////**********************END OF QUEUE IMPEMENTATION ********************////


//function prototype declarations

void allocateAdjList(AdjList *);
void insertAtHead(GraphNode **, char);
void insertNeighbor(AdjList *, char , char);
void inputNodes(AdjList *);
void displayGraph(AdjList*);
char * getNeibors(AdjList*, char, int);
void initializeNodeStatus(AdjList *);
void DFS(AdjList *, char);
void BFS(AdjList *, char);


void initializeNodeStatus(AdjList *ptrAdjList){
    //initializes each nodes status field to 0
    int i;          
    for(i=0;i<ptrAdjList->nodeCount;i++){  
        (ptrAdjList->adjListHead+i)->STATUS=0;
       
    }
             
}


GraphNode* setNodeStatus(AdjList * ptrAdjList, char nodeChar, int STATUS){
    int i=0;
    for(i=0;i<ptrAdjList->nodeCount;i++){
        if((ptrAdjList->adjListHead+i)->nodeVal==nodeChar){
            (ptrAdjList->adjListHead+i)->STATUS=STATUS;
            break;
        }
    }
    return (ptrAdjList->adjListHead+i)->next;//return the neighbor list
}
int getNodeStatus(AdjList *ptrAdjList, char nodeChar){
    int i=0;
    for(i=0;i<ptrAdjList->nodeCount;i++){
        if((ptrAdjList->adjListHead+i)->nodeVal==nodeChar){          
            break;
        }
    }
    return (ptrAdjList->adjListHead+i)->STATUS;
}

void BFS(AdjList *ptrAdjList, char startNodeVal){
    int i, found;
    Queue queue;
    char pCh;
    GraphNode *neighborList;
    //initialize the stack;
    queue.rear = SIZE-1;
    queue.front = SIZE-1;
    //initialize graph
    initializeNodeStatus(ptrAdjList);
    //check if start node exists
    found = FALSE;
    for(i=0;i<ptrAdjList->nodeCount;i++){
        if ((ptrAdjList->adjListHead+i)->nodeVal==startNodeVal){
           found = TRUE;
           break;
        }
    }
    if (!found){
        printf(" :( Start Node: %c not found\n", startNodeVal);
        return;
    }
    //if start node found push it into the stack
    queueInsert(&queue, (ptrAdjList->adjListHead+i)->nodeVal);
    //set the status of the start node to 1;
    (ptrAdjList->adjListHead+i)->STATUS=1;
    printf("BFS LIST: ");
    while(queue.rear!=queue.front){
        pCh = queueRetrieve(&queue);
        printf("%4c",pCh);
        neighborList = setNodeStatus(ptrAdjList,pCh,2);
        for(;neighborList!='\0';neighborList=neighborList->next){
            if (getNodeStatus(ptrAdjList,neighborList->nodeVal)==0){
                queueInsert(&queue, neighborList->nodeVal);
                setNodeStatus(ptrAdjList,neighborList->nodeVal,1);
            }
        }
    }
 
    printf("\n");
 
 
}


void DFS(AdjList *ptrAdjList, char startNodeVal){
    int i, found;
    Stack stack;
    char pCh;
    GraphNode *neighborList;
    //initialize the stack;
    stack.top = -1;
    //initialize graph
    initializeNodeStatus(ptrAdjList);
    //check if start node exists
    found = FALSE;
    for(i=0;i<ptrAdjList->nodeCount;i++){
        if ((ptrAdjList->adjListHead+i)->nodeVal==startNodeVal){
           found = TRUE;
           break;
        }
    }
    if (!found){
        printf(" :( Start Node: %c not found\n", startNodeVal);
        return;
    }
    //if start node found push it into the stack
    push(&stack, (ptrAdjList->adjListHead+i)->nodeVal);
    //set the status of the start node to 1;
    (ptrAdjList->adjListHead+i)->STATUS=1;
    printf("DFS LIST: ");
    while(stack.top!=-1){
        pCh = pop(&stack);
        printf("%4c",pCh);
        neighborList = setNodeStatus(ptrAdjList,pCh,2);
        for(;neighborList!='\0';neighborList=neighborList->next){
            if (getNodeStatus(ptrAdjList,neighborList->nodeVal)==0){
                push(&stack, neighborList->nodeVal);
                setNodeStatus(ptrAdjList,neighborList->nodeVal,1);
            }
        }
    }
 
    printf("\n");
 
 
}

void allocateAdjList(AdjList *ptrAdjList){
    //allocate the array of head pointers for holding
    //the list of neighbor for each node.
    //if the function returns 0 then memory allocation failed
    //otherwise on success it returns the size of memory allocated (a +ve value)
    int i=0;
    ptrAdjList->adjListHead = (GraphNode *)malloc(sizeof(GraphNode) * ptrAdjList->nodeCount);
    if (ptrAdjList->adjListHead=='\0'){
        printf(":( Unable to allocate memory\nterminating the programe\n");
        exit(0);
    }
    //initialize head of each list
    for(i=0;i<ptrAdjList->nodeCount;i++){      
        ptrAdjList->adjListHead[i].next = '\0';
    }      
}

void insertAtHead(GraphNode **hp, char nodeValue){
    //inserts a node at the head of the linked list
    //hp is the pointer to the head (actually its the next pointer of the AdjList node array.)
    GraphNode *p;
    //create a new node.
    p = (GraphNode*)malloc(sizeof(GraphNode));  
    if (p == '\0'){
        printf("Unable to allocate memory for node\nterminating application\n");
        exit(0);
    }
    p->nodeVal = nodeValue;
    p->next = *hp;
    *hp = p;
}


void insertNeighbor(AdjList *ptrAdjList, char targetNode, char neighborNode){  
    //inserts the neighborNode as the neighbor of the targetNode;
    int i=0;

 
   if (debugMode)
     printf("@Debug %c-%c\n",targetNode,neighborNode);
 
 
   for(i=0;i<ptrAdjList->nodeCount;i++){
       if ((ptrAdjList->adjListHead+i)->nodeVal==targetNode){
           insertAtHead( &((ptrAdjList->adjListHead[i]).next),neighborNode);
       
       }
       else if ((ptrAdjList->adjListHead+i)->nodeVal==neighborNode){
           insertAtHead( &((ptrAdjList->adjListHead[i]).next),targetNode);        
       }
   }
}

void inputNodes(AdjList *ptrAdjList){
    int i=0;
    if (ptrAdjList->nodeCount==0)
        return;
    for(i=0;i<ptrAdjList->nodeCount;i++){
        printf("Next Node [characters allowed only(a,b,c,1,2,3 ....)]: ");
        scanf(" %c",&((ptrAdjList->adjListHead+i)->nodeVal));
    }
}

void inputEdges(AdjList *ptrAdjList){
    int i=0, ec,nc;
    char firstNode, secondNode;
    if (ptrAdjList->nodeCount==0)
        return;
    nc = ptrAdjList->nodeCount;
 
    do{
        printf("How Many edges: ");
        scanf(" %d",&ec);
        if (ec>((nc*(nc-1))/2))
        printf(" Invalid Number of edges...\ntry input again \n");
    }while(ec>(nc*(nc-1))/2);
 
    ptrAdjList->edgeCount=ec;
 
    for(i=0;i<ptrAdjList->edgeCount;i++){
        printf("Enter edge in the format a-b (if a,b forms an edge): ");      
        scanf(" %c%*c%c",&firstNode,&secondNode); //skipping the minus sign
     
     
        //insert the neighbour into the adjList
        insertNeighbor(ptrAdjList,firstNode, secondNode);
    }
 
}

void displayGraph(AdjList *ptrAdjList){
    int i,k=0,t;
    char nodeVal;
    GraphNode *p;
    boolean alreadyDisplayed;
    char displayed[ptrAdjList->edgeCount][ptrAdjList->edgeCount];
 
    printf("\n\tV={");
    for(i=0;i<ptrAdjList->nodeCount;i++){
        printf("%4c,",(ptrAdjList->adjListHead+i)->nodeVal);
    }
    printf("\b }\n\tE={");
    for(i=0;i<ptrAdjList->nodeCount;i++){
        nodeVal = (ptrAdjList->adjListHead+i)->nodeVal;
        if(debugMode){
            printf("@Debug: %c\n",nodeVal);
        }
        for(p=(ptrAdjList->adjListHead+i)->next;p!='\0';p=p->next){
            alreadyDisplayed= FALSE;
            for(t=0;t<k;t++){
                if ((displayed[t][0]==nodeVal && displayed[t][1]==p->nodeVal)||
                        (displayed[t][0]==p->nodeVal && displayed[t][1]==nodeVal)){
                    alreadyDisplayed=TRUE;
                    break;
                }
            }
            if(!alreadyDisplayed){
                printf("%c-%c,",nodeVal,p->nodeVal);
                displayed[k][0] = nodeVal;
                displayed[k++][1] = p->nodeVal;
            }
        }
     
    }
    printf("\b }\n\n");
}

int main(int argc, char** argv) {
    AdjList adjList;
    int choice;char startNode;
    printf("Enter total Number of Nodes: ");
    scanf(" %d",&adjList.nodeCount);
 
 
    allocateAdjList(&adjList);
    inputNodes(&adjList);
    inputEdges(&adjList);
 
    do{
        printf("1. BFS\n");
        printf("2. DFS\n");
        printf("3. Display\n");
        printf("4. Both DFS & BFS\n");
        printf("5. Exit\n");
        printf("Please enter your choice: ");
        scanf(" %d", &choice);
        switch(choice){
            case 1:printf("Enter Start Node: ");
                   scanf(" %c",&startNode);
                   BFS(&adjList,startNode);
                   break;
            case 2:printf("Enter Start Node: ");
                   scanf(" %c",&startNode);
                   DFS(&adjList,startNode);
                   break;
         
            case 3:displayGraph(&adjList);
                        break;
            case 4:printf("Enter Start Node: ");
                   scanf(" %c",&startNode);
                   DFS(&adjList,startNode);
                   BFS(&adjList,startNode);
                   break;
            case 5:exit(0);
            default: printf("Invalid Choice\n");                                
        }
     
 
    }while(1);
 
    return (EXIT_SUCCESS);
}

Sunday 2 June 2013

c,c++,computer architecture,tech news, gadget

To see the all post of this blog just click this below link.


http://suvotechmania.blogspot.in/search?updated-min=2013-01-01T00:00:00-08:00&updated-max=2014-01-01T00:00:00-08:00&max-results=24http://suvotechmania.blogspot.in/search?updated-min=2013-01-01T00:00:00-08:00&updated-max=2014-01-01T00:00:00-08:00&max-results=24

Want to trace/track any mobile?

Want to trace/track any mobile...........????????

locate /trace/track any mobile no, By visiting this site
http://suvotechmania.blogspot.in/ you will be able to know the exact location of that mobile no.
just see the right side of the upper phase of this blog and enter the 10 digits of the mobile
no., which you want to find and press the Trace button and you will be able to trace/track any mobile in India .

SWAPPING....----><-------

Swapping----><-----

#include<stdio.h>
#include<conio.h> 
int swap(int*, int*);
int main()
{
   int x, y;
   printf("Enter the value of x and y\n");
   scanf("%d%d",&x,&y);
   printf("Before Swapping\nx = %d\ny = %d\n", x, y);
   swap(&x, &y); 
   printf("After Swapping\nx = %d\ny = %d\n", x, y);
   getch();
   return 0;
   
}
int swap(int *a, int *b)
{
   int temp;
   temp = *b;
   *b = *a;
   *a = temp;   
}

Structure & pointer


Structure & pointer


#include <stdio.h>
#include <conio.h>


struct record
{
char name[20];
int roll;
};
struct record r,*p;

void main()
{
p=&r;
printf("\nEnter the name\n");
scanf("\n%s",&p->name);
printf("\nEnter the roll no\n");
scanf("%d",&p->roll);
printf("\n%s",p->name);
printf("\n%d",p->roll);
getch();
}