From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 659/CH6/EX6.2cs/Casestudy6_2.sce | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 659/CH6/EX6.2cs/Casestudy6_2.sce (limited to '659/CH6/EX6.2cs/Casestudy6_2.sce') diff --git a/659/CH6/EX6.2cs/Casestudy6_2.sce b/659/CH6/EX6.2cs/Casestudy6_2.sce new file mode 100755 index 000000000..3cbb2eec8 --- /dev/null +++ b/659/CH6/EX6.2cs/Casestudy6_2.sce @@ -0,0 +1,30 @@ +// Case Study:-Chapter 6 +// 2.Histogram + +N=5; +for n=1:N + printf("Enter employees in Group-%d:",n); + value(n)=scanf("%d"); //Read data in the array named value + printf("%d\n",value(n)); //Print number which is at position n +end +printf("\n"); +printf(" |\n"); +//Computation using for loop and draw a histogram +for n=1:N + for i=1:3 + if(i==2) then + printf("Group-%1d |",n); + else + printf(" |"); + end + for j=1:value(n) + printf("*"); + end + if(i==2) + printf("(%d)\n",value(n)); + else + printf("\n"); + end + end + printf(" |\n"); +end \ No newline at end of file -- cgit