Plz debug this...
Can neone plz debug the below program ...
Plz dont mind .I just started programming .... Here... #include<stdio.h> //Program to search occurence of a particular character in an array int main(void) { char a[20]; int n,i,count; char c; printf("Enter the no of the characters in the array\n"); scanf("%d",&n); printf("Enter the characters into the array\n"); for(i=0;i<n;i++) { scanf("%c",&a[i]); } printf("Enter the character u want to search\n"); scanf("%c",&c); for(i=0;i<n;i++) { count=1; if(a[i]==c) { printf("%d's occurence at %d\n",count,i); count++; } } return 0; } Can neone suggest me a good site for learning C?? Thx for learning.... |
You already posted this in another forum (I know because I replied to it recently)
Please don't post things twice. Makes it hard for people to find the info they need. |
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.
http://www.linuxquestions.org/rules.php |
|
All times are GMT -5. The time now is 09:33 PM. |