NPTEL » Problem solving Programming In C Assignment 2021

Problem solving through Programming In C

NPTEL Problem solving through Programming In C With the growth of Information and Communication Technology, there is a need to develop large and complex software.

Problem-solving through Programming In C is a MOOC based course that is 12 weeks in duration and can fulfill the criteria of 4 credits in a year. You can visit the NPTEL SWAYAM platform and register yourself for the course. The course is developed by Prof. Anupam Basu is a Professor in the Dept. of Computer Science & Engineering, IIT Kharagpur, and has been an active researcher in the areas of Cognitive and Intelligent Systems, Embedded Systems, and Language Processing, Presently he is acting as the Chairman and Head of the Center for Educational Technology, IIT Kharagpur.

Problem Solving Through Programming in C 2021 Details:-

  1. Who Can Join: This is an elective course. Intended for senior UG/PG students. BE/ME/MS/PhD
  2. Requirements/Prerequisites: We will assume that the students know to program for some of the assignments. If the students have done introductory courses on probability theory and linear algebra it would be helpful. We will review some of the basic topics in the first two weeks as well.
  3. INDUSTRY SUPPORT: All IT Industries

Problem Solving In C Programming Assignment Week 12 Answers:-

Q1. Which of the following are themselves a collection of different data types?

Answer:- d) Structure

Q2. Which of the following comments about the usage structures is true?

Answer:- c) The scope of the member name is confined to the particular structure, within which it is defined

Q3. What will be the output of the following program?

Answer:-d) 0 1 2 2 3

Q4. What will be the output?

Answer:- c) 10 5 10

Q5. What is the output of the c program?

Answer:- a) 2036 2036 2036

Q6. The program will allocate …. bytes to ptr. Assume sizeof(int)=4

Answer:- c) 8

Q7. What will be the output?

Answer:- d) compilation error

Q8. What will be the output?

Answer:- b) 1111101

Q9. Calling a function f with a an array variable a[3] where a is an array, is equivalent to

Answer:- d) all of the mentioned

Q10. What will be the output?

Answer:- a) True

Problem Solving In C Programming Assignment Week 11 Answers:-

Q1. Interpolation is a process for

Answer:- b) finding a value between two points on a line or curve.

Q2. Given two data points (a,f(a)) and (b,f(b)), the linear Lagrange polynomial f(x) that passes through these two points

Answer:- D

Q3. A lagrange polynomial passes through three data points as given below:-

Answer:- b) 13.08

Q4. The value of by using one segment trapezodial rule is

Answer:- 22.5962

Q5. Accuracy of the trapezoidal rule increases when

Answer:- c) number of segments are increased

Q6. Solve the ordinary differential equation below using Runge-kutta 4th order method.

Answer:- b) 2.93

Q7. using bisection method negative root of

Answer:- b) -2.706

Q8. match the following

Answer:- a) A-2, B-4, C-1, D-3

Q9. The real root of equation 5x-2cosx-1=0

Answer:- a) 0.53 to 0.56

Q10. consider the same recursive c function that takes two arguments

Answer:- 2

Problem Solving In C Quiz Assignment Week 10 Answers:-

Q1. How can you improve the best-case efficiency in bubble sort? (The input is already sorted)

Answer:- C

Q2. Bisection method is used to find

Answer:- C – Root of a function

Q3. In ……………, search starts at the beginning of the list and checks every element in the list.

Answer:- a) Linear search

Q4. What is the output of the following code?

Answer:-B – 30

Q5. Assuming an initial range [1,5]. the second (at the end of 2 iterations) iterative value of the root of te t- 0.3 = 0 using the bisection method is (Note: you %3D need to find the root, not the function value)

Answer:- 2

QUIZXP TELEGRAM

Q6. What would be the equivalent pointer expression for referring to the array element a[i][j][k][l]?

Answer:- b) *(*(*(*(a+i)+j)+k)+l)

Q7. What will be output when you will execute the following c code?

Answer:- a) 23,11

Q8. Assume sizeof an integer and a pointer is 2 byte. What is the output?

Answer:- b) 80

Q9. Find output of the following code?

Answer:- 5,5

QUIZXP TELEGRAM

Q10. What is the solution of the equation given below using the Bisection Method up to four decimal places? (Consider the root lying on positive quadrant only and compute the root till five iterations only)

f(x) = xe2x – 3×2 – 5

Answer:- 1.0312

Problem Solving In C Quiz Assignment Week 8 Answers:-

Q1. A function prototype is used for

Answer:- c) Telling the compiler, the kind of arguments used in the function

Q2. What is the output of the following c code?

Answer:- b) 1 2

Q3. How many times ‘Hi’ will be printed?

Answer:- c) Infinite times

Q4. What is the output of the C code given below?

Answer:- a) 27.08

quizxp telegram

Q5. Which statement is correct about Passing by value parameters?

Answer:- b) It can change the actual parameter value

Q6. what will be the output?

Answer:- c) Compilation error

Q7. How many times hello world will be printed?

Answer:- a) Infinite times

Q8. What will be the output?

Answer:- d) 2, 0, 4, 8, 0

quizxp telegram

Q9. Consider the following functions?

Answer:- d) Minimum of a and b

Q10. Consider the function?

Answer:- c) 91

Problem Solving In C Quiz Assignment Week 7 Answers:-

Q1. Which of the following statements are correct?
1) A string is a collection of characters terminated by ‘\0’.
2) The format specifier %s is used to print a string.
3) The length of the string can be obtained by using the function strlen().
4) The pointer cannot work on string

Answer:- b) 1,2,3

Q2. The correct method of initializing a 2D array is

Answer:- a) – int abc[2][2] = {1, 2, 3 ,4} 

Q3. Array passed as an argument to a function is interpreted as

Answer:- c) Address of the first element of the array

Q4. What will be the output?

Answer:- 10

quizxp telegram

Q5. Find the output of the following c program?

Answer:- a)     fellows

Q6. what will be the output?

Answer:- a) n1=18, n2=17

Q7. consider the following c program segment?

Answer:- d) Nothing is printed

Q8. If the starting address of a floating point array Arr[10][10] is 2000,
what would be the memory address of the element Arr[5][6]? (Considering float takes 4 bytes of memory)

Answer:- c) 2224

quizxp telegram

Q9. In C, the placement of elements of a two dimensional array is

Answer:- a) Row wise

Q10. What will be the value of ‘i’ after execution?

Answer:- 0

Problem Solving In C Quiz Assignment Week 6 Answers:-

Q1.Which of the statements is correct?

Answer:- D

Q2. An integer array of size 15 is declared in a C program. The memory location of the first byte of the array is 2000. What will be the location of the 13th element of the array? Assume int data type takes 2 bytes of memory.

Answer:- B

Q3. Which statement is correct?

Answer:- A

Q4. What will happen if in a C program you assign a value to an array element whose index exceeds the size of array?

Answer:- D

Q5. Which of the following statements is correct for the following code snippet?
int num[7];
num[7]=8;

Answer:- C

Q6. What will be the output?

Answer:- B

Q7.What will be the output?

Answer:- A

Q8.What will be the output?

Answer:- D

Q9.What will be the output?

Answer:- 8

Q10.What will be the output?

Answer:- C

Problem Solving In C Quiz Assignment Week 5 Answers:-

Q1. In C language three way transfer of control is possible using

Answer:- A – Ternary operator

Q2. The loop in which the statements within the loop are executed at least once is called

Answer:- B) do-while

Q3. What will be the output?

#include <stdio.h> 
int main()
{
float k = 0;
for (k = 0.5; k< 3; k++)
printf("I love C'n");

return 0;
}

Answer:-c) I love C — will be printed 3 times

quizxp telegram

Q4. What will be the output?

#include <stdio.h>
int main()
{
int i=1;
do
{
printf("while vs do-while\n");
}
while(i==1);
printf("Out of loop");
return 0;
}

Answer:- d) ‘while vs do-while’ infinite times

PROGRAMMING ASSIGNMENT Problem Solving In C Assignment Week 5

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

Answer:- d) Compiler error

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

#include <stdio.h>

int main()

{ 

int a = 0, i, b;

for (i = 0; i <= 2; i+=0.5)

{

a++;

continue;
}
printf("%d", a);

return 0;
}

Answer:- d) No output

quizxp telegram

Q7. What will be the output?

#include <stdio.h>

int main()

{ 
int i=0;
for(;;)
{
if(i=10)
break;
printf("%d ", ++i);
}
return 0;

}

Answer:- c) 1 2 3 4 5 6 7 8 9 10

Q8.What is the output of the following C program?

#include <stdio.h> 
int main()

{
    int a = 1;
    if(a--)
printf("True \n");
if(+a)

printf("False \n");



return 0;
}

Answer:- c) Both ‘True’ and ‘False’

Q9.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;
}

Answer:- b) 7,4

Q10. What will be the value of ‘i’ after executing the program?

#include <stdio.h>

int main()

{ 
int i=1,j;
for(i=0; j<=10; j+=i)
{
i=i+j;
printf("the num is ", i);
}

return 0;
}

Answer:- d) 13

Problem Solving In C Quiz Assignment Week 4 Answers:-

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

Answer:- A) if-else statements

Q2. What is the output of the following code?

#include <stdio.h>
 int main() {
int x = 1;
if (x == 0)
if (x >= 0) 
printf("x=0\n");
else
printf("x=1\n");
return 0;
}

Answer:- D) No print statements

Q3. Compute the printed value of i of the compiler given below

#include<stdio.h>
int main()
{
int i=2;
i=i++;
printf("%d", i);
return 0;
}

Answer:- A) 2

Q4. If multiple conditions are used in a single if statement then the testing of those conditions are done

Answer:- B) From Left to right

quizxp telegram

Q5. What is the purpose of the program?

#include <stdio.h>
int main()
{
int n, x=0, y;
printf("Enter an integer: ");
 scanf("%d", &n); 
while (n !=0) 
{
y=n % 10;
X=X - y;
n=n/10;
}
printf("Output is = %d", x);
return 0;
}

Answer:- B) Negative sum of the digits of a number

Q6. while(1) is used in a program to create

Answer:- B) Infinite loop

Q7. What will be the value of a, b, c after the execution of the followings

int a=5, b=7, c=111;
c/=++a * b-;

Answer:- C) a=6, b=6, c=2;

Q8. What will be printed when the following C code is executed?

 #include<stdio.h>
int main()
{
if('A'<a")
printf("NPTEL");
 else printf("PROGRAMMING");
 return 0;
}

Answer:- A) NPTEL

Q9. Switch statement accepts

Answer:- D) All of the above

Q10. What will be the output?

Answer:- C) Both (a) and (b)

Problem Solving In C Quiz Assignment Week 3 Answers:-

Q1. The precedence of arithmetic operators is (from highest to lowest)

Answer:- A

Q2. What is the output of the following program?

Answer:- D

Q3. Find the output of the following C code?

Answer:- 15

Q4. Find the output of the following C code?

Answer:- 4

quizxp telegram

Q5. What will be the output of the code?

Answer:- FALSE

Q6. Find the output of the following C code?

Answer:- IITKGP

Q7. Find the output of the following C code?

Answer:- TRUE

Q8. Which of the following statement is correct?

Answer:- A

Q9. Which of the following method are accepted for assignment?

Answer:- C

Q10. Find the output of the following C code?

Answer:- A

Problem Solving In C Quiz Assignment Week 2 Answers:-

Q1. Which of the them are not used as a variable in C programming?

Answer/Code:- C) 123Var

Q2 – Which of the following is not a correct variable type in C?

Answer/Code:- D) All of above are correct variable type

Q3 – The execution of any C program is

Answer:- A) Sequential

Q4 – Which of the following statements is correct?
I. Keywords are those words whose meaning is already defined by Compiler.
II. Keywords cannot be used as variable names.
III. There are 32 keywords in C.
IV. C keywords are also known as reserved words.

Answer:- D) All of the above

Q5 – A function is

Answer:- D) All of the above

Q6 – What will be the output? [N.B: – .2f is used to print up to 2 decimal places of a floating point number]

Answer:- D) 12.00

Q7 – What is the output of the following C code?

Answer:- C) 79

Q8 – If integer needs two bytes of storage, then the minimum value of a signed integer in C would be

Answer:- D – 2^15

Q9 – What is the output of the following C code?

Answer:- D) Compilation Error

Q10 – What is the output?

Answer:- 18.50

Problem Solving In C Quiz Assignment Week 1 Answers:-

Find Other Quiz Here:

NPTEL » Programming in C++ Assignment week 01 2021

Amazon Fashion Quiz Answers & Win ₹1000

Amazon Great Indian Festival Quiz Answers: Win Rs. 50,000

NPTEL » Programming In Java Assignment week 6 Sep-2020

NPTEL » Programming In Java Assignment week 7 Sep-2020

NOTE: These codes are based on our knowledge. Answers might be incorrect, we suggest you not copy-paste answers blindly.

[foobar id=”1315″]