943,892 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1152
  • C RSS
You are currently viewing page 1 of this multi-page discussion thread
Jan 21st, 2009
0

how to add the mobile number in the employee information system in c language

Expand Post »
Hello,
I am developing the project of "Employee Information System" using C language, In this project i want to add the mobile number for the each employee {Each Mobile number having 7 characters, Bcoz if we using the integer means, Any of one employee has no mobile number it’s not print the "0000000" format of mobile number} So if it okay means You will send the clear details about, "How to add the mobile number and also How to increase that to each employee "ASAP.
Contact Mail ID : [removed]

Thanks & Regards,
B.Karthikeyan
Last edited by Narue; Jan 21st, 2009 at 1:20 pm. Reason: snipped emails
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
karthisargunan is offline Offline
6 posts
since Jan 2009
Jan 21st, 2009
0

Re: how to add the mobile number in the employee information system in c language

Use char string[10] .
Last edited by ithelp; Jan 21st, 2009 at 8:05 am.
Reputation Points: 769
Solved Threads: 128
Banned
ithelp is offline Offline
1,910 posts
since May 2006
Jan 21st, 2009
0

Re: how to add the mobile number in the employee information system in c language

Click to Expand / Collapse  Quote originally posted by ithelp ...
Use char string[10] .
thanks fore ur reply.
But i need the number are automatically incrementing that is If u enter Mobile no :1234567 for employee 1 na 2nd employee will directly get the next no that is 1234568
Reply me ASAP.

Regards,
B.Karthikeyan
Reputation Points: 10
Solved Threads: 0
Newbie Poster
karthisargunan is offline Offline
6 posts
since Jan 2009
Jan 21st, 2009
0

Re: how to add the mobile number in the employee information system in c language

It seems as if you have a solution in mind, why don't you try to implement it and if you have any trouble, post your code along with the question. (Something like "I expected it to do ___ but it is doing ___")

Oh, and when posting c code, please use c code tags
[code=c]
/* Your code here */
[/code]
Reputation Points: 344
Solved Threads: 116
Practically a Master Poster
Murtan is offline Offline
670 posts
since May 2008
Jan 21st, 2009
0

Re: how to add the mobile number in the employee information system in c language

You can enter the first mobile number
  1. scanf("%d",&mobileno[0];
rest all the numbers will be as
  1. for(i=0;i<n;i++)
  2. mobileno[i+1]=mobile[i]+1;
Reputation Points: 6
Solved Threads: 9
Junior Poster in Training
ajay.krish123 is offline Offline
90 posts
since Nov 2008
Jan 22nd, 2009
0

Re: how to add the mobile number in the employee information system in c language

Click to Expand / Collapse  Quote originally posted by Murtan ...
It seems as if you have a solution in mind, why don't you try to implement it and if you have any trouble, post your code along with the question. (Something like "I expected it to do ___ but it is doing ___")

Oh, and when posting c code, please use c code tags
[code=c]
/* Your code here */
[/code]


HI,

I store employee's 7digit phone number as string. I want to allocate numbers to them For each employee the phone number should be 1 value greater than previous employee.
So, I need to increment ph number by 1.
How to increment a string?
Regards,
Karthikeyan.B
Reputation Points: 10
Solved Threads: 0
Newbie Poster
karthisargunan is offline Offline
6 posts
since Jan 2009
Jan 22nd, 2009
1

Re: how to add the mobile number in the employee information system in c language

Please don't answer each post since your last with the same string, we all have to read through all of them.

I can't imagine any phone system where you can pre-order sequential 7 digit phone numbers, but ignoring that for now...

Why does the 7 digit phone number have to be a string?

Or if it does, why can't you convert it from a string to a number, add one and convert it back?

If you're REALLY desperate, you could convert the last character of the phone number to a number and add 1. If the number is now 10, put a '0' down for the last digit and 'carry' the one to the next-to-the last character. (At least that's how I learned to do manual addition when I was in school.)
Reputation Points: 344
Solved Threads: 116
Practically a Master Poster
Murtan is offline Offline
670 posts
since May 2008
Jan 22nd, 2009
0

Re: how to add the mobile number in the employee information system in c language

Click to Expand / Collapse  Quote originally posted by Murtan ...
Please don't answer each post since your last with the same string, we all have to read through all of them.

I can't imagine any phone system where you can pre-order sequential 7 digit phone numbers, but ignoring that for now...

Why does the 7 digit phone number have to be a string?

Or if it does, why can't you convert it from a string to a number, add one and convert it back?

If you're REALLY desperate, you could convert the last character of the phone number to a number and add 1. If the number is now 10, put a '0' down for the last digit and 'carry' the one to the next-to-the last character. (At least that's how I learned to do manual addition when I was in school.)

Hi,
Bcoz,1 employee is not having a mobile no means, output for that employee is 0000000 by using string,But if i am using integer means its not possible.That y i asked you.
Regards,
Karthikeyan.B
Reputation Points: 10
Solved Threads: 0
Newbie Poster
karthisargunan is offline Offline
6 posts
since Jan 2009
Jan 22nd, 2009
0

Re: how to add the mobile number in the employee information system in c language

What about the rest of the post?

Why can't you convert from a string to a number, add one and convert it back?

And if an employee didn't have a mobile, I'd leave the field blank, not fill it with zeros.
Last edited by Murtan; Jan 22nd, 2009 at 2:34 am.
Reputation Points: 344
Solved Threads: 116
Practically a Master Poster
Murtan is offline Offline
670 posts
since May 2008
Jan 22nd, 2009
0

Re: how to add the mobile number in the employee information system in c language

What code have you tried until now??
Reputation Points: 6
Solved Threads: 9
Junior Poster in Training
ajay.krish123 is offline Offline
90 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Network Programming Questions
Next Thread in C Forum Timeline: can we allocate a 2d array dynamically in c





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC