Problem Solving Through Programming In C

NPTEL Problem solving through Programming In C Assignment 3 Answers 2022

NPTEL Problem solving through Programming In C Assignment 3 Answers 2022 :- Here All The Questions and Answers Provided to Help All The Students and NPTEL Candidate as a Reference Purpose, It is Mandetory to Submit Your Weekly Assignment By Your Own Understand Level.

 

Are you looking for the Assignment Answers to NPTEL Problem solving through Programming In C Assignment 3 Answers 2022? If Yes You are in Our Great Place to Getting Your Solution, This Post Should be help you with the Assignment answer to the National Programme on Technology Enhanced Learning (NPTEL) Course “NPTEL Problem solving through Programming In C Week 3 Solution 2022

 

NPTEL Problem solving through Programming In C

From My Side :

This course is aimed at enabling the students to :
Formulate easy algorithms for arithmetic and investigative problems

Translate the algorithms to programs (in C language)

Test and kill the programs and truthful syntax and investigative errors

Implement conditional branching, iteration and recursion

Decompose a tortured into functions and synthesize a unmodified program using divide and conquer right of admission

Use arrays, pointers and structures to formulate algorithms and programs

Apply programming to solve matrix adding occurring together and multiplication problems and searching and sorting problems

Apply programming to solve easy numerical method problems, namely rot finding of doing, differentiation of do something and easy integration

This course is aimed at enabling the students to. Formulate easy algorithms for arithmetic and rational problems. Translate the algorithms to programs (in C language) Test and execute the programs and precise syntax and logical errors.

10 Steps to Solving a Programming Problem.
Read the difficulty at least three era (or however many makes you setting satisfying)
Work through the shackle manually taking into account at least three sets of sample data.
Simplify and optimize your steps.
Write pseudocode.
Translate pseudocode into code and debug.

This course is aimed at enabling the students to :
  • Formulate simple algorithms for arithmetic and logical problems
  • Translate the algorithms to programs (in C language)
  • Test and execute the programs and  correct syntax and logical errors
  • Implement conditional branching, iteration and recursion
  • Decompose a problem into functions and synthesize a complete program using divide and conquer approach
  • Use arrays, pointers and structures to formulate algorithms and programs
  • Apply programming to solve matrix addition and multiplication problems and searching and sorting problems
  • Apply programming to solve simple numerical method problems, namely rot finding of function, differentiation of function and simple integration
INTENDED AUDIENCE : BE/BTech  in all disciplines BCA/MCA/M. Sc
INDUSTRY SUPPORT   : All IT Industries

CRITERIA TO GET A CERTIFICATE

This course can have Associate in Nursing unproctored programming communication conjointly excluding the Proctored communication, please check announcement section for date and time. The programming communication can have a weightage of twenty fifth towards the ultimate score.

Final score = Assignment score + Unproctored programming exam score + Proctored Exam score
  • Assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course.
  • ( All assignments in a particular week will be counted towards final scoring – quizzes and programming assignments). 
  • Unproctored programming exam score = 25% of the average scores obtained as part of Unproctored programming exam – out of 100
  • Proctored Exam score =50% of the proctored certification exam score out of 100
YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF ASSIGNMENT SCORE >=10/25 AND
UNPROCTORED PROGRAMMING EXAM SCORE >=10/25 AND PROCTORED EXAM SCORE >= 20/50. 
If any one of the 3 criteria is not met, you will not be eligible for the certificate even if the Final score >= 40/100. 

CHECK HERE OTHERS NPTEL ASSIGNMENTS ANSWERS 

BELOW YOU CAN GET YOUR NPTEL Problem solving through Programming In C Assignment 3 Answers 2022? :

 

NPTEL Problem solving through Programming In C Assignment 3 Answers 2022

Q1. Which of the following statements is correct?

a) Operator precedence determines which operator is performed first in an expression with more than one operator with different precedence. Associativity is used when two operators of same precedence appear in an expression
b) Operator associativity determines which operator is performed first in an expression with more than one operator with different associativity. Precedence is used when two operators of same precedence appear in an expression
c) Operator precedence and associativity are same.
d) None of the above

Answer: a)

Q2. What is the output of the following program?

#include<stdio.h>
int main()
{
int x=11, y=5, z;
float w;
z=x%y;
w=x/y;
printf(“Value of z and w are %d and %f respectively”, z, w);
return 0;
}
a) Value of z and w are 1 and 2 respectively
b) Value of z and w are 1 and 2.200000 respectively
c) Value of z and w are 1.000000 and 2.200000 respectively
d) Value of z and w are 1 and 2.000000 respectively

Answer: d)

Q3. What will be the output?

#include<stdio.h>
int main()
{
int a=4, b=15, c=29;
if(c>b>a)
printf(“TRUE”);
else
printf(“FALSE”);
return 0;
}
a) TRUE
b) FALSE
c) Syntax Error
d) Compilation Error

Answer: b)

Q4. What will be the output of following program?

#include<stdio.h>
int main()
{
int x=(10 || 0) && (10);
printf(“x=%d”, x);
}
a) x=60
b) x=70
c) x=0
d) x=1

Answer: d) x=1

Q5. What will be the output?

#include<stdio.h>
int main()
{
int x=17, y=1;
if(!(!x) && y)
printf(“%d”, x);
else
printf(“%d”, y);
return 0;
}
a) 17
b) 18
c) 1
d) 0

Answer: a) 17

Q6. What is the output of the following C code?

#include<stdio.h>
int main()
{
int x=7, y=3, z=5;
printf(“%d\n”, x-x/y*y%z);
return 0;
}
a) 7
b) 6
c) 5
d) 0

Answer: b) 6

Q7. What will be the output?

#include<stdio.h>
int main()
{
int x;
x = (11+3)%5/2;
printf(“%d\n”, x);
return 0;
}
a) 0
b) 1
c) 2
d) Compilation error

Answer: c) 2

Q8. Find the output of the following C code

#include<stdio.h>
int main()
{
int a=3, b=2;
a=a=b=0
printf(“%d, %d”, a,b);
return 0;
}
a) 1,2
b) 0,0
c) 3,2
d) 1,0

Answer: a) 1,2

Q9. The output of the following program will be

#include<stdio.h>
int main()
{
int a=0, b=1, c=-1;
if(a)
printf(“IITKGP\n”);
if(b)
printf(“IITM \n”);
if(c)
printf(“IITR \n”);
return 0;
}
a) IITKGP
b) IITMIITR
c) IITM
IITR
d) IITKGP
IITR

Answer: c)

Q10. What is the output of this C code?

#include<stdio.h>
int main()
{
int x = 10;
if(x>0)
printf(“inside if\n”);
else if(x>0)
printf(“inside elseif\n”);
return 0;
}
a) inside if
b) inside elseif
c) inside if
inside elseif
d) compile time error

Answer: a) inside if

PROBLEM SOLVING THROUGH PROGRAMMING IN C NPTEL WEEK 3 PROGRAMS Assignment

Write a C Program to calculates the area (floating point number with two decimal places) of a Circle given it’s radius (integer value). The value of Pi is 3.14.

#include <stdio.h>
#define PI 3.14
void main()
{
int radius;
float area;
/* Enter the radius of a circle */
scanf(“%d”, &radius);

area = PI * radius * radius;

printf(“Area of a circle = %5.2f\n”, area);
}

Write a C program to check if a given Number is zero or Positive or Negative Using if…else statement.

#include <stdio.h>
int main()
{
double number;
scanf(“%lf”, &number);
/* The number is entered automatically from the test cases and executed */
/* Write the rest of the code in the box below
As the output should exactly match with the output mentioned in the test cases
so copy and paste the following printf statements wherever and whichever is applicable
printf(“The number is 0.”);
printf(“Negative number.”);
printf(“Positive number.”);
Do not use any other scanf statements */

if(number == 0)
printf(“The number is 0.”);
else if(number < 0)
printf(“Negative number.”);
else
printf(“Positive number.”);

}

Write a C program to check whether a given number (integer) is Even or Odd.

#include <stdio.h>
int main()
{
int number;
scanf(“%d”, &number); /*An integer number is taken from the test case */

/* Write the rest of the program in the box provided below. As the output
should exactly match with the output provided in the test cases so use exactly the
following printf statement wherever and whichever is applicable.

printf(“%d is even.”, number);
printf(“%d is odd.”, number);
*/

if(number%2 == 0)
printf(“%d is even.”, number);
else
printf(“%d is odd.”, number);

}

Write a C Program to find the Largest Number (integer) among Three Numbers (integers) using IF and Logical && operator.

#include <stdio.h>
int main()
{
int n1, n2, n3;

scanf(“%d %d %d”, &n1, &n2, &n3); /*Three numbers are accepted from the test case */

/* Complete the code in the box provided below. Use printf statement as provided below:
printf(“%d is the largest number.”, n1);
It may be n1, n2 or n3.
*/

if((n1 > n2) && (n1 > n3))
printf(“%d is the largest number.”, n1);
else if(n2 > n3)
printf(“%d is the largest number.”, n2);
else
printf(“%d is the largest number.”, n3);

}