Answer the question
In order to leave comments, you need to log in
Why is it not reading the line?
I can't figure out why it doesn't read the line:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
void main()
{
char c, String[50];
int count = 0, i;
puts("Input string: ");
gets(String);
puts("Input character: ");
scanf("%s", &c);
for(i=0; i<strlen(String); i++)
{
if(String[i]==c)
{
count++;
}
}
printf("Count of characters %s %d", c,count);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question