Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
WAP in C to delete an element from an array
//gcc 5.4.0 #include <stdio.h> int main(void) { char ar[100]= "NIDHI"; int position= 4, c, n,count=0,i; for (i=0; ar[i]!='\0';i++) { count++; } n= count; if ( position >= n ) printf("Deletion not possible.\n"); else { for ( c = position ; c <n ; c++ ) { ar[c] = ar[c+1]; } } for( c = 0 ; c <n ; c++) { printf("%s\n", ar); ar[c]='\0'; } }
run
|
edit
|
history
|
help
1
Please
log in
to post a comment.
bit wise operation
orange blue bell Einstein's piece chastitise then
Random by thread
challoc
FizzBuzz
C(gcc) Local Time and math.h Example
cstructHotel
C_141113_dividirRestasSucesivas
bitwise manipulation
lab pro v.05
Please log in to post a comment.