NPTEL Problem solving through Programming In C Assignment 5 Answers 2022
NPTEL Problem solving through Programming In C Assignment 5 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 5 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 5 Solution 2022”
Table of Contents
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.
- 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
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.
- 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
UNPROCTORED PROGRAMMING EXAM SCORE >=10/25 AND PROCTORED EXAM SCORE >= 20/50.
CHECK HERE OTHERS NPTEL ASSIGNMENTS ANSWERS
BELOW YOU CAN GET YOUR NPTEL Problem solving through Programming In C Assignment 5 Answers 2022? :
NPTEL Problem solving through Programming In C Assignment 5 Answers 2022
Q1. Continue statement used
a) to continue to the next line of code
b) to debug
c) to stop the current iteration and begin the next iteration from the beginning
d) None of the above statements are correct
Answer By SciShowEngineer
Answer: c) to stop the current iteration and begin the next iteration from the beginning
Q2. What will be the output?
#include<stdio.h>
int main()
{
if((0 && 1)||(1 && -1))
printf(“Condition is true.”);
else
printf(“Condition is false.”);
return 0;
}
a) Condition is true
b) Condition is false
c) Compilation Error
d) No output possible
Answer By SciShowEngineer
Answer: a) Condition is true
Q3. Compute the printed value of i of the C program given below
#include<stdio.h>
int main()
{
int i = 0, j = 0;
while(i<4, j<5)
{
i++;
j++;
}
printf(“%d, %d\n”, i, j);
return 0;
}
a) 4, 5
b) 4, 4
c) 5, 5
d) 0, 0
Answer By SciShowEngineer
Answer: c) 5, 5
Q4. What will be the output?
#include<stdio.h>
int main()
{
switch(printf(“IIT”))
{
default:
printf(” Guwahati”);
case 1: printf(” Delhi”);
break;
case 2: printf(” Kharagpur”);
break;
case 3: printf(” Madras”);
break;
}
return 0;
}
a) IIT Delhi
b) IIT Kharagpur
c) IIT Madras
d) IIT Guwahati
Answer By SciShowEngineer
Answer: d) IIT Guwahati
Q5. Find the output of the following C program.
#include<stdio.h>
int main()
{
int i = 0;
if(i==0)
{
i = i + 1;
break;
}
printf(“%d”, i);
return 0;
}
a) 0
b) 1
c) No output
d) Compiler error
Answer By SciShowEngineer
Answer: d) Compiler error
Q6. What will be printed when the following code is executed?
#include<stdio.h>
int main()
{
int i=0;
for(;i<=9;)
{
i++;
printf(“%d”, i);
}
return 0;
}
a) 0 1 2 … 9
b) 0 1 2 … 10
c) 1 2 3 … 9
d) 1 2 3 … 10
Answer By SciShowEngineer
Answer: d) 1 2 3 … 10
Q7. What is the output of the below C program?
#include<stdio.h>
int main()
{
short int k=1, j=1;
while(k <= 4 || j <=3)
{
k = k + 2;
j += 1;
}
printf(“%d,%d”, k,j);
return 0;
}
a) 5, 4
b) 7, 4
c) 5, 6
d) 6, 4
Answer By SciShowEngineer
Answer: b) 7, 4
Q8. What will be the output?
#include<stdio.h>
int main()
{
int i=0;
for(;;)
{
if(i==10)
continue;
printf(“%d”, ++i);
}
return 0;
}
a) 0 1 2 3 4 5 6 7 8 9 11 12 … infinite times
b) 1 2 3 4 5 6 7 8 9 11 12 … infinite times
c) Nothing will be printed
d) Compilation Error
Answer By SciShowEngineer
Answer: c) Nothing will be printed
Q9. What will be the output?
#include<stdio.h>
int main()
{
int x=1;
do
{
x++;
continue;
printf(“%d”, x);
break;
}while(x<=2);
printf(“\nAfter loop x=%d”, x);
printf(“\n”);
return 0;
}
a) After loop x=1
b) 1
After loop x=2
c) 1 2
After loop x=3
d) After loop x=3
Answer By SciShowEngineer
Answer: d) After loop x=3
Q10. What will be the output?
#include<stdio.h>
int main()
{
int x;
x = 4 > 8 ? 5 !=1 < 5 == 0 ? 1:2:3;
printf(“%d”, x);
return 0;
}
a) 1
b) 2
c) 3
d) Error
Answer By SciShowEngineer
Answer: c) 3
Problem solving through Programming In C Week 5 Assignments Solutions
Write a C program to count total number of digits of an Integer number (N).
#include <stdio.h>
int main()
{
int N;
scanf(“%d”,&N); /*The number is accepted from the test case data*/
/* Complete the rest of the code. Please use the printf statements as below
by just changing the variables used in your program
printf(“The number %d contains %d digits.”, N, count);
*/
int num = N, count = 0;
while(num > 0) {
num = num / 10;
count++;
}
printf(“The number %d contains %d digits.”, N, count);
return 0;
}
Write a C program to find sum of following series where the value of N is taken as input
1+ 1/2 + 1/3 + 1/4 + 1/5 + .. 1/N
#include<stdio.h>
int main()
{
int N;
float sum = 0.0;
scanf(“%d”,&N); /*Read the value of N from test cases provided*/
/* Complete the program. Please use the printf statement given below:
printf(“Sum of the series is: %.2f\n”, sum);
*/
for(int i=1; i<=N; i++){
sum += (float)1/i;
}
printf(“Sum of the series is: %.2f\n”, sum);
return 0;
}
Write a C program to print the following Pyramid pattern upto Nth row. Where N (number of rows to be printed) is taken as input. For example when the value of N is 5 the pyramid will be printed as follows
*****
****
***
**
*
#include<stdio.h>
int main()
{
int N;
scanf(“%d”, &N); /*The value of N is taken as input from the test case */
for(int i=N; i>0; i–) {
for(int j=1; j<=i; j++) {
printf(“*”);
}
printf(“\n”);
}
return 0;
}
Write a C program to find sum of following series where the value of N(odd integer number) is taken as input
12+32+52+…..+n2
#include<stdio.h>
int main()
{
int n, sum=0;
scanf(“%d”,&n); //Value of n is taken from the test cases
for(int i=1; i<=n; i=i+2){
sum += i*i;
}
printf(“Sum = %d”, sum);
return 0;
}
Yhaa You have done it but next? if YOU Want to your Others NPTEL Problem solving through Programming In C Assignments Answers Then Follow US HERE and Join Telegram.