deleting item from array

deleting item from array - Q w r i te C program to delete...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Q : w r i te C++ program to delete num in a r ray by enter it index then shifting a r ray up and putting 0 in last item ? #include<iostream.h> #include<stdio.h> void main() { int a[10],x; for (int i=0;i<10;i++) { printf("\n enter scanf("%d",&a[i]); } for (i=0;i<10;i++) { printf("\n enter } cout<<endl<<"enter index = cin>>x; for(i=x;i<10-1;i++){ a[i]=a[i+1]; } a[i]=0; for (i=0;i<10;i++) { printf("\n enter }} a[ %d ] = %d ",i,a[i]); "; a[ %d ] = %d ",i,a[i]); a[ %d ] = ",i); ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online