| | |
Help
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2007
Posts: 21
Reputation:
Solved Threads: 0
Dear All,
Please help me regarding this C++ Assignment.
Q.1
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
Q.2
Write a macros in which swap two number without using 3rd variable and then call
Macro in main function.
Hint: a=4, b=2 after swapping a=2, b=4.
Please help me regarding this C++ Assignment.
Q.1
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
Q.2
Write a macros in which swap two number without using 3rd variable and then call
Macro in main function.
Hint: a=4, b=2 after swapping a=2, b=4.
Also, pick better subjects. http://catb.org/~esr/faqs/smart-questions.html#bespecific
You may as well have posted a blank message for all the good that "help" does.
> Write a macros in which swap two number without using 3rd variable
Not this old chestnut.
malloc and crusty macro hacks in C++ - I'm really not that impressed with your "teacher".
You may as well have posted a blank message for all the good that "help" does.
> Write a macros in which swap two number without using 3rd variable
Not this old chestnut.
malloc and crusty macro hacks in C++ - I'm really not that impressed with your "teacher".
![]() |
Other Threads in the C++ Forum
- Previous Thread: Data validation- want only Int's
- Next Thread: Doesn't open for file input successfully.... why?
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






