Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
string.c
//gcc 5.4.0 #include <stdio.h> #include <string.h> int main(void) { char buf[80] = "venkata kona chandra reddy lokireddy "; int i=0,j=0,len=0; char *buf1 ,*buf2; printf("Enter the Statement\n"); //fgets(buf,sizeof(buf),stdin); buf1 = malloc(80); buf2 = malloc(80); printf("Statement= %s\n",buf); while(buf[i]) { if(buf[i] != ' ') { buf1[j++]=buf[i]; // printf("j = %d\n",j); } else { if (len < j){ len = j; strcpy(buf2,buf1); printf("buf2 =%s,buf1=%s len =%d\n",buf2,buf1,len); } j=0; } i++; } printf("string = %s,length = %d\n",buf2,len); return 0; }
run
|
edit
|
history
|
help
0
bit shift and mask
Busqueda binaria version iterativa
Ahora si?
150109_RecursividadFibonacci
A_141117_Euclides
MatrixMul_shortxshort
CO_assign_q4
selection sort
150116_OrdenMatriz
Prime