By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,918 Members | 2,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,918 IT Pros & Developers. It's quick & easy.

malloc function.

P: 2
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
Share this Question
Share on Google+
18 Replies


P: 33
I must say that's a useful hint!!
Jun 6 '07 #2

100+
P: 208
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
Expert 100+
P: 1,251
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
Expert 100+
P: 1,764
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
Expert 100+
P: 844
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
Expert 100+
P: 1,251
Oh come on, that is being rude!
I'm on the fence on that one.


Adrian
Jun 6 '07 #7

100+
P: 208
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
Expert 100+
P: 844
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
Expert 100+
P: 1,764
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

100+
P: 208
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
Expert 100+
P: 1,251
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
Expert 100+
P: 1,764
Post it in the Feedback forum.


Adrian
Good idea,thanks..

Savage
Jun 6 '07 #13

Savage
Expert 100+
P: 1,764
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

100+
P: 208
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
Expert 100+
P: 1,764
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
Expert 100+
P: 1,251
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
Expert 100+
P: 1,764
What if they are a speed reader? :D


Adrian
Allready answered in Feedback forum..

Savage
Jun 7 '07 #18

pbmods
Expert 5K+
P: 5,821
Erm... getting back OT....
Jun 7 '07 #19

Post your reply

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