Showing posts with label switch case. Show all posts
Showing posts with label switch case. Show all posts

Thursday, September 27, 2012

Doubly Linked Lists Implementation using oops of c plus plus | Data Structure

Doubly Linked Lists Implementation using oops of c plus plus | Data Structure

Doubly Linked Lists Implementation using oops of c plus plus | Data Structure
By Sanjay Sinalkar
Write a program in c++ using object oriented concept to create Double Linklist which having following functionality 

1)Insert element at Begin
2)Insert element at given position
3)Insert element at End
4)Delete element from Begin
5)Delete element From End
6)Delete element from Given position
 7) Show all element Inserted in Display function()
Program should validate given position before calling given position operation such as Insert or Delete

Sunday, September 2, 2012

Calculator Operation Using Switch Case C program

Calculator Operation Using Switch Case C program

This program specially for Calculator Operation Using Switch Case C program which can do Addition,Subtractions,Multiplication,Division mathematical operations. It also has Menu to do Such Options in Simple Formats

/* Program For Addition,Subtraction,Division,Multiplication*/
#include<stdio.h>

int main()
{
int a,b,c;

while(1)
{
printf("\n****Choose The Following Options****\n");
printf("-Press 1 for Additions\n");
printf("-Press 2 for Subtractions\n");
printf("-Press 3 for Multiplication\n");
printf("-Press 4 for Divisions\n");
printf("-Press 5 for Exit\n");
scanf("%d",&c);
if(c==5)
 break;
printf("Please Enter two nos:");
scanf("%d %d",&a,&b);
switch(c)
{
case 1:printf("\nAdditions is:\t%d",a+b);
 break;
case 2:printf("\nSubtractions is:\t%d",a-b);
 break;
case 3:printf("\nMultiplication is:\t%d",a*b);
 break;
case 4:printf("\nDivision is:\t%d",a/b);
 break;
default:printf("\n Invalid Choice....!\n");
 continue;
}
}

return 0;


}