Page 302 - computer science (868) class 11
P. 302
33 }
34 ar[size-1]="";
35 System.out.println("After removing the name, the left over students
are: ");
36 for (i=0; i<size-2; i++)
37 {
38 System.out.print(ar[i]+" ");
39 }
40 }
41 else
42 {
43 System.out.println(nd+" not found");
44 }
45 }
46 }
The output of the preceding program is as follows:
Output 1:
Enter the number of students
10
Enter the name of the student: Amar
Enter the name of the student: Alok
Enter the name of the student: Rajan
Enter the name of the student: Sachin
Enter the name of the student: Amit
Enter the name of the student: Lalit
Enter the name of the student: Shubham
Enter the name of the student: Anaya
Enter the name of the student: Raman
Enter the name of the student: Rakesh
Enter a name to be deleted:
Lalit
After removing the name, the left over students are:
Amar Alok Rajan Sachin Amit Shubham Anaya Raman
Output 2:
Enter the number of students
10
Enter the name of the student: Arjun
Enter the name of the student: Anaya
Enter the name of the student: Shikha
300300 Touchpad Computer Science-XI

