SEARCHING NUMERIC , ALPHANUMERIC WORD FROM SENTENCE

SEARCHING NUMERIC , ALPHANUMERIC WORD FROM SENTENCE

Page 1 of 1

3 Replies - 3510 Views - Last Post: 16 September 2008 - 08:52 AM Rate Topic: -----

#1 asadkhanno1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 16-September 08

SEARCHING NUMERIC , ALPHANUMERIC WORD FROM SENTENCE

Post icon  Posted 16 September 2008 - 03:03 AM

salam
i have an assignment which is 10 marks so i have a question how i make a program which take sentence just like "I m in 2nd semister doing bscs i have 6 course each course contain 100 marks"
then its print
numeric word :6,100
alphabetic :I m in semister doing bscs i have course each course contain marks.
alphanumeric :2nd
PLZ HELP ME OUT SIMLPE CODE IN C LANGUAGE

HELLO PLZ E-MAIL ME IF U KNOW THE CODING PLZ E-MAIL THE CODING MY E-MAIL ASADYARKHAN007@HOTMAIL.COM

Is This A Good Question/Topic? 0
  • +

Replies To: SEARCHING NUMERIC , ALPHANUMERIC WORD FROM SENTENCE

#2 AmitTheInfinity  Icon User is offline

  • C Surfing ∞
  • member icon

Reputation: 117
  • View blog
  • Posts: 1,559
  • Joined: 25-January 07

Re: SEARCHING NUMERIC , ALPHANUMERIC WORD FROM SENTENCE

Posted 16 September 2008 - 03:16 AM

Wellcome to Dream In Code.

I hope you have read this already.
Was This Post Helpful? 0
  • +
  • -

#3 asadkhanno1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 16-September 08

Re: SEARCHING NUMERIC , ALPHANUMERIC WORD FROM SENTENCE

Posted 16 September 2008 - 05:58 AM

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main(void)
{
clrscr();
char *temp,string[200],alphanumeric[40],alphabetic[200],numeric[100];
char ch;
int num,i=0,j=0,k=0;
//for(i=0;i<100;i++)
//numeric[i]='\0';

printf("\n PLZ ENTER SPECIFIC WORD");


gets(string);

while(i<200)
{

	if (string[i]=='\0')
	break;

	if(string[i]>=48&&string[i]<=57)
	{

	numeric[k]=string[i];
	//printf("\nnumeric =%c\n",numeric[k]);
	k++;
	i++;
	}
else
	{
	alphabetic[j]=string[i];
	//printf("aplha = %c \n",alphabetic[j]);
	j++;
	i++;
	}
}
printf("NUMERIC WORD =");
puts(numeric);
printf("APLHAPBETIC WORD =");
puts(alphabetic);
//for(i=0;i<20;i++)
//{
//if(numeric[i]=='\0')
//break;
//printf("%c",numeric[i]);
//}
getch();
}



NOW plzz tell me how i extract the code alphanumeric if i give a sentence when i give (2nd) it is alphanumeric but it show "2" in numeric & "nd" in alphabetic iwant this in alphanumeric

Mod Edit: Please use code tags when posting your code. Code tags are used like so => :code:

Thanks,
PsychoCoder :)
Was This Post Helpful? 0
  • +
  • -

#4 AmitTheInfinity  Icon User is offline

  • C Surfing ∞
  • member icon

Reputation: 117
  • View blog
  • Posts: 1,559
  • Joined: 25-January 07

Re: SEARCHING NUMERIC , ALPHANUMERIC WORD FROM SENTENCE

Posted 16 September 2008 - 08:52 AM

I think you need to have a look at this header file. It will solve most of your problems.

And yes, whatever you showed as your efforts is all waste according to me. That's nowhere near to what you want to do in your assignment. I hope you will be able to make it better after reading the link given above. All the best.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1