Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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
0
Please
log in
to post a comment.
Example of scanf and basic integer manipulation - with function call
Calculating longs v0.5 finish b next lab
hwkpractice
C_141120_factorial02
Revprint
22nd HW Switchv1.0
Strncpy memcpy
14th Dec Project1 v0.4
A_141205_CADENAS
Project 3 Part 1 v1.0
stackse - search stackoverflow differently
Please log in to post a comment.