LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 02-02-2004, 04:04 PM   #1
balanagireddy
Member
 
Registered: Sep 2003
Location: India
Distribution: redhat linux 9.0
Posts: 46

Rep: Reputation: 15
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....
 
Old 02-02-2004, 06:32 PM   #2
teval
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Gentoo
Posts: 720

Rep: Reputation: 30
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.
 
Old 02-02-2004, 06:34 PM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
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
 
Old 02-03-2004, 04:17 PM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
http://www.linuxquestions.org/questi...hreadid=141526
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
plz plz help me regarding route mapping nedian123 Programming 1 07-13-2004 08:17 AM
plz plz solve my route mapping problem nedian123 Linux - Networking 1 07-12-2004 09:41 PM
[debug]what does the following debug information mean icoming Programming 21 06-08-2004 02:13 AM
Plz debug this balanagireddy Programming 5 02-03-2004 12:11 PM
redhat problems plz plz help sap666 Linux - Newbie 5 07-30-2003 10:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration