#include <stdio.h>
void main()
{
int i=0,j=0;
char c;
printf("Please enter:\n");
while((c=getchar())! while((c=getchar())! ='\n')
{
if(c=='a')i++;
if(c=='E')j++;
}
printf("a: %d of E: %d of \n",i,j);
}
(2) Program as follows:
# include <stdio.h>
#include <string.h>
void main()
{
char a[30]="asdjttheklthewn",b[10]="the";
< p>printf("str first address:%x,first occurrence of string the:%x\n",a,strstr(a,b));}