An Introduction To Programming Through C++
IIT Bombay.
Week 5- Programming Assignment 1:
The "signature" of a function is the first line which gives the return type, the name of the function and the parameters with their types. As an example the signature of the gcd function is
int gcd(int m, int n)
Sample Test Cases
int gcd(int m, int n)
The function multiprint has the following signature.
void multiprint(char c, int n)
The function is required to print n copies of the character c. Write the function.
There will invisible code which tests the function. It will call multiprint with certain values and print the result.
Input | Output | |
Test Case 1 | . 3 | ... |
Test Case 2 | * 5 | ***** |
WRITE/COPY THESE CODE DIRECTLY IN NPTEL TERMINAL AND COMPILE AND RUN THEN SUBMIT.
PROGRAM:void multiprint(char c, int n)
{
for(int i=0;i<n;i++)
cout << c;
}
CLICK ON BELOW LINK.
<<CLICK HERE FOR WEEK 5:PROGRAMMING -02>>
<<CLICK HERE FOR WEEK 6: QUIZ ASSIGNMENT 1>>
FOLLOW OUR WEBSITE FROM THE BUTTON PROVIDED TO THE BOTTOM OF PAGE TO GET SOON ANSWERS OF PROGRAMS.
Disclaimer: Here you can find all nptel assignment solutions related to CS stream.These may help you for your assignment.The answers are only for verification.You cannot copy these directly from the post(code of conduct of NPTEL).These is not 1
What does the following print?
ReplyDelete