NPTEL Introduction to programming in C Assignment 1 Answers 2024

NPTEL Introduction to programming in C Assignment 1 Answers 2024

Hello learners In this article we are going to discuss NPTEL Introduction to programming in C Assignment 1 Answers. All the Answers provided below to help the students as a reference, You must submit your assignment with your own knowledge and use this article as reference only.

About the course:-

This is a course in programming in C. No prior programming experience is assumed; however, mathematical maturity at the level of a second year science or engineering undergraduate is assumed. We emphasize solving problems using the language, and introduce standard programming techniques like alternation, iteration and recursion. We will briefly glimpse the basics of software engineering practices like modularization, commenting, and naming conventions which help in collaborating and programming in teams. 

NPTEL Introduction to programming in C Assignment 1 Answers 2024:

1. You have a certain number of 100 rupee notes, 10 rupee notes and 1 rupee notes with you.

There is an item you want to buy whose price is given to you.

Write a program to find if the item is affordable, that is the price of the item is less than or equal to the current money you have.

Input

Four non negative integers. 

The first input is an integer representing the number of 100 rupee notes.

The second input is an integer representing the number of 10 rupee notes.

The third input is an integer representing the number of 1 rupee notes.

The fourth input is an integer representing the price of the item.

Output

You have to output 1 if the item is affordable.

You have to output 0 if the item is not affordable.

Answer :- Will update answers soon and update on our telegram channel so Join Click Here

2.  Given three distinct integers a b and c, write a C program to find the second largest number among them.

Input

Three distinct integers a b c.

The first input is the integer a.

The second input is the integer b.

The third input is is the integer c.

Output

The second largest among a, b and c

Answer :-

3. Given the coefficients of a pair of linear equations,

a1x+b1y=c1a2x+b2y=c2

Find the solutions to x and y

Input
Input consists two lines.
The first line contains coefficients of first equation,  a1b1c1 in that order

The second line contains coefficients of second equation,  a2b2c2 in that order


Output

The solutions to x and y.

Note : You can assume that both x and y will always be integers.
You can also assume that the solution is unique.

Answer :-