472,119 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

malloc function.

hi
send me solution of this asignment

Write a program using malloc function. In which you take input from user and allocate memory equal to square of this number. Which multiply numbers and draw a table in the following format?

Hint: User enters 3 then program allocates equal to 9 integer memories.

Output:1

Enter a single digit number:
2
The multiplication table of 2 is:
1 2
----------------
1| 1 2
2| 2 4

Output:2

Enter a single digit number:
4
The multiplication table of 4 is:
1 2 3 4
--------------------------------
1| 1 2 3 4
2| 2 4 6 8
3| 3 6 9 12
4| 4 8 12 16
Jun 6 '07 #1
18 2300
I must say that's a useful hint!!
Jun 6 '07 #2
Silent1Mezzo
208 100+
hi
send me solution of this asignment

Write a program using malloc function. In which you take input from user and allocate memory equal to square of this number. Which multiply numbers and draw a table in the following format?

Hint: User enters 3 then program allocates equal to 9 integer memories.

Output:1

Enter a single digit number:
2
The multiplication table of 2 is:
1 2
----------------
1| 1 2
2| 2 4

Output:2

Enter a single digit number:
4
The multiplication table of 4 is:
1 2 3 4
--------------------------------
1| 1 2 3 4
2| 2 4 6 8
3| 3 6 9 12
4| 4 8 12 16

We don't just give you the solution...Thats why people fail out of computer science courses. If you'd work on it yourself and then bring to us your questions we could help you then.
Jun 6 '07 #3
AdrianH
1,251 Expert 1GB
We don't just give you the solution...Thats why people fail out of computer science courses. If you'd work on it yourself and then bring to us your questions we could help you then.
No, that is how you give a school a bad rap. ;)

You get some looser saying that they have got a degree or certificate in something, they get hired and the moron can't do anything. The company then fires the idiot, black lists him/her and the school from within the company and all other companies they know.

But HIRA HAMEED isn’t one of those. S/he is one to do the work and post a question when s/he gets stuck. RIGHT?


Adrian
Jun 6 '07 #4
Savage
1,764 Expert 1GB
hi
send me solution of this asignment

Write a program using malloc function. In which you take input from user and allocate memory equal to square of this number. Which multiply numbers and draw a table in the following format?

Hint: User enters 3 then program allocates equal to 9 integer memories.

Output:1

Enter a single digit number:
2
The multiplication table of 2 is:
1 2
----------------
1| 1 2
2| 2 4

Output:2

Enter a single digit number:
4
The multiplication table of 4 is:
1 2 3 4
--------------------------------
1| 1 2 3 4
2| 2 4 6 8
3| 3 6 9 12
4| 4 8 12 16
Don't be so rude,give OP a full solution.

Here ,u go.

Now make sure that u understand it.OK?
Savage
Jun 6 '07 #5
ilikepython
844 Expert 512MB
Don't be so rude,give OP a full solution.

Here ,u go.

Now make sure that u understand it.OK?
Savage
Oh come on, that is being rude!
Jun 6 '07 #6
AdrianH
1,251 Expert 1GB
Oh come on, that is being rude!
I'm on the fence on that one.


Adrian
Jun 6 '07 #7
Silent1Mezzo
208 100+
I'm on the fence on that one.


Adrian
Agreed, while it's not the nicest approach, people that don't read the rules really do need to be told
Jun 6 '07 #8
ilikepython
844 Expert 512MB
Agreed, while it's not the nicest approach, people that don't read the rules really do need to be told
I was only joking and that's a good point. Almost every day there at least 2 or 3 new threads going like this:

Problem plzplzplz due tom

<assignment copied and pasted>

plzplzplz its really urgent
Jun 6 '07 #9
Savage
1,764 Expert 1GB
I was only joking and that's a good point. Almost every day there at least 2 or 3 new threads going like this:

Problem plzplzplz due tom

<assignment copied and pasted>

plzplzplz its really urgent
Yea,is it possibly ,when new user is registering, to put on a posting guidelines like one of condtions to join the site?

Savage
Jun 6 '07 #10
Silent1Mezzo
208 100+
Yea,is it possibly ,when new user is registering, to put on a posting guidelines like one of condtions to join the site?

Savage
You mean the conditions that you just press the "Accept Checkbox" without ever looking at?
Jun 6 '07 #11
AdrianH
1,251 Expert 1GB
Yea,is it possibly ,when new user is registering, to put on a posting guidelines like one of condtions to join the site?

Savage
Post it in the Feedback forum.


Adrian
Jun 6 '07 #12
Savage
1,764 Expert 1GB
Post it in the Feedback forum.


Adrian
Good idea,thanks..

Savage
Jun 6 '07 #13
Savage
1,764 Expert 1GB
You mean the conditions that you just press the "Accept Checkbox" without ever looking at?
No,I mean condition which must be readed.It should be maded so that user can countinue registration only if he has scrolled to the bottom of the posting guidelines and if atleast 10 minutes have passed.

Savage
Jun 6 '07 #14
Silent1Mezzo
208 100+
No,I mean condition which must be readed.It should be maded so that user can countinue registration only if he has scrolled to the bottom of the posting guidelines and if atleast 10 minutes have passed.

Savage
Haha 10 minutes...and the site registration would plummet to zero :P People would just think the site freezed up.
Jun 7 '07 #15
Savage
1,764 Expert 1GB
Haha 10 minutes...and the site registration would plummet to zero :P People would just think the site freezed up.
hahah,then we write with big bold characters:

"The site is not frozen.Plese read posting guidelines to continue.U have 10 minutes left"

Savage
Jun 7 '07 #16
AdrianH
1,251 Expert 1GB
hahah,then we write with big bold characters:

"The site is not frozen.Plese read posting guidelines to continue.U have 10 minutes left"

Savage
What if they are a speed reader? :D


Adrian
Jun 7 '07 #17
Savage
1,764 Expert 1GB
What if they are a speed reader? :D


Adrian
Allready answered in Feedback forum..

Savage
Jun 7 '07 #18
pbmods
5,821 Expert 4TB
Erm... getting back OT....
Jun 7 '07 #19

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

14 posts views Thread by Joseph | last post: by
34 posts views Thread by Richard Hunt | last post: by
231 posts views Thread by Brian Blais | last post: by
68 posts views Thread by James Dow Allen | last post: by
58 posts views Thread by Jorge Peixoto de Morais Neto | last post: by
71 posts views Thread by desktop | last post: by
10 posts views Thread by somenath | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.