1) Write a program to count the number of blank spaces in a given string. 2) Write a program to abbreviate a given string (e.g. if the input is Amar Akbar Anthony, the output will be AAA)
r u trying to put your homework on our shoulders? newayz..i can help u out...i m showing u how to do the first one then the second one u try out urself.... 1) Code: # include<stdio.h> # include<conio.h> # include<malloc.h> void main() { char *p; int count=0; clrscr(); p=(char *)malloc(100*sizeof(char)); gets(p); while(*p!='\0') { if(*p==' ') { count++; ++p; } else ++p; } printf("%d",count); }