Problem Solving Through Programming In C

NPTEL Problem solving through Programming In C Assignment 4 Answers 2022

NPTEL Problem solving through Programming In C Assignment 4 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 4 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 WeekSolution 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 4 Answers 2022? :

 

NPTEL Problem solving through Programming In C Assignment 4 Answers 2022

Q1. In the C program, ‘&’ is used in ‘scanf’ to indicate

a) AND operation
b) Memory location
c) Value of the variable
d) Value at the memory location.

Answer: b) Memory location

Q2. The control/conditional statements used in C is/are

a) if-else statements
b) switch statements
c) Both (a) and (b)
d) None of these

Answer: c) Both (a) and (b)

Q3. What is the other statement that can avoid multiple nested if conditions?

a) Functions
b) Switch statements
c) If-else statements with ‘break’
d) Loop statements

Answer: b) Switch statements

Q4. The loop which is executed at least one is

a) while
b) do-while
c) for
d) none of the above

Answer: b) do-while

Q5. if (a == 1||b == 2){} can be written as:

a) if (a == 1)
if (b == 2){}
b) if (a == 1){}
if (b == 2){}
c) if (a == 1){}
else if (b == 2){}
d) none of the mentioned

Answer: d) none of the mentioned

Q6. What will be the output of the following code

int main()
{
int x, y = 5, z = 5;
x = y == z;
printf(“%d”, x);
return 0;
}
a) 5
b) 1
c) 0
d) None of these

Answer: b) 1

Q7. Which statement is correct for the following lines?

switch(temperatureInCelsius)
{
case<35:
printf(“hot day!”);
default:
printf(“not that hot day!”);
}
a) It’s perfectly fine
b) It will print both statements
c) It will give a compilation error
d) More information required

Answer: c) It will give a compilation error

Q8. What will be the output of the given program?

#include<stdio.h>
void main()
{
float num=5.6;
switch(num){
case 5: printf(“5”);
case 6: printf(“6”);
default: printf(“0”);
break;
}
printf(“%d”, num);
}
a) 5 5.600000
b) 6 5.600000
c) 5 6 0 5.600000
d) Compile error

Answer: d) Compile error

Q9. What will be the value of a, b, c after execution of the followings
int a=5, b=7, c=111;
c/=++a*b–;

a) a=5, b=6, c=2
b) a=6, b=7, c=1
c) a=6, b=6, c=2
d) a=5, b=7, c=1

Answer: c) a=6, b=6, c=2

Q10. What will be output of the following program?

#include<stdio.h>
int main(){
int a=0, b=10;
if(a=0){
printf(“true”);
}
else{
printf(“false”);
}
return 0;
}
a) true
b) false
c) 0
d) 1

Answer: b) false

Write a C Program to Find the Smallest Number among Three Numbers (integer values) using Nested IF-Else statement.

#include <stdio.h>
int main()
{
int n1, n2, n3;
scanf(“%d %d %d”, &n1, &n2, &n3); /* where three number are read from the test cases and are stored in the variable n1, n2 and n3 */

if((n1 < n2) && (n1 < n3))
printf(“%d is the smallest number.”, n1);
else if(n2 < n3)
printf(“%d is the smallest number.”, n2);
else
printf(“%d is the smallest number.”, n3);
}

Write a C program to find power of a number using while loops. The base number (>0) and exponent (>=0) is taken from the test cases.

#include <stdio.h>
int main()
{
int base, exponent;
long int result;
scanf(“%d”, &base); //The base value is taken from test case
scanf(“%d”, &exponent); //The exponent value is taken from test case

result = 1;
while(exponent > 0) {
result *= base;
exponent -=1;
}

printf(“The result is : %ld\n”, result);
return 0;
}

Write a C program to calculate the Sum of First and the Last Digit of a given Number. For example if the number is 1234 the result is 1+4 = 5.

#include <stdio.h>
int main()
{

int N, First_digit, Last_digit;

scanf(“%d”, &N); //The number is accepted from the test case

Last_digit = N % 10;

while(N > 0) {
First_digit = N;
N = N / 10;
}

printf(“Sum of First and Last digit = %d”, First_digit + Last_digit);

return 0;
}

Write a program to find the factorial of a given number using while loop.

#include<stdio.h>
void main()
{
int n;
long int fact; /* n is the number whose factorial we have to find and fact is the factorial */
scanf(“%d”,&n); /* The value of n is taken from test cases */

fact = 1;
int num = n;
while(num>0) {
fact = fact * num;
num–;
}
printf(“The Factorial of %d is : %ld”,n,fact);
}