WEEK:5 PROGRAMMING ASSIGNMENT 1 SOLUTION (Jan 2020-Apr2020) An Introduction to Programming through C++ NPTEL 2020

  

               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)

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.

Sample Test Cases

InputOutput
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;
}



WEEK-5:PROGRAMMING ASSIGNMENT 2  AND QUIZ 
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

1 comment:

If you have any problems related to solutions or any concept please let me know.

Copyright (c) 2020 Custom Programs All Right Reserved

Pages