Run Code
|
API
|
Code Wall
|
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
signaling NaN test
A_141107_Potencia
Humko
3468
SAI_1-6.c
888 BONUS LAB 1
FunPointBreakfast
Assignment 3
Assignment 2
2