NPTEL Problem solving through Programming In C Assignment 3 AnswersΒ 2023:- In this post, We have provided answers of NPTEL Problem Solving Through Programming In C Assignment 3 week 3. We provided answers here only for reference. Plz, do your assignment at your own knowledge.
NPTEL Problem Solving Through Programming In C Week 3 Assignment Answers 2023
1. Which of the following statement 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 :-
2. Find the output of the following C code?
#include <stdio.h>
int main() {
int a = 50, b = 20, c = 6, d = 3, result;
result = a + a * -b / c % d + c * d;
printf("%d", result);
return 0;
}
a) 67
b) -36
c) 66
d) -37
Answer :- For Answer Click Here
3. What is the output of the following C code?
#include <stdio.h>
int main() {
int h = 8;
int b = 4 * 6 + 3 * 4 < h * 5 ? 24 : 3;
printf("%d\n", b);
return 0;
}
a) 0
b) 3
c) 4
d) Compilation error
Answer :-
4. Find the output of the following C code?
#include <stdio.h>
int main() {
int x = 1;
if ((3 * 25) > (2 * 53))
printf("IITKGP\n");
else if (x &= 0)
printf("IITD\n");
else
printf("IITM\n");
return 0;
}
a) IITKGP
b) IITD and IITM
c) IITKGP and IITM
d) IITM
Answer :- For Answer Click Here
5. What will be the output?
a) Condition is true
b) Condition is false
c) Error
d) No output possible
Answer :-
6. What is the output of the following program?
a) Programming on C 0
b) NPTEL 0
c) NPTEL 3
d) Compilation error
Answer :- For Answer Click Here
7. What is the output of the C program given below
a) true
b) false
c) Compiler dependent
d) Compiler error
Answer :-
8. What will be the output?
a) 0
b) 1
c) 10
d) 30
Answer :- For Answer Click Here
9. What will be the output
a) TRUE
b) FALSE
c) Syntax Error
d) Compilation Error
Answer :-
10. What is the output of the following C code?
a) 10
b) 11
c) 20
d) Compiler error
Answer :- For Answer Click Here
Course Name | Problem Solving Through Programming In C |
Category | NPTEL Assignment Answer |
Home | Click Here |
Join Us on Telegram | Click Here |
NPTEL Problem solving through Programming In C Assignment 3 Answers 2022
Q1. Find the output of the following C program
#include<stdio.h>
int main()
{
int a, z, x=10, y=12;
z=x*y++;
a=x*y;
printf(“%d, %d”, z, a);
return 0;
}
a) 120, 120
b) 120, 130
c) 130, 120
d) 130, 130
Answer:- b
2. What will be the output of the following program?
#include<stdio.h>
int main()
{
int p=2;
int m=10;
int k;
k=!((p<2)&&(m>2));
printf(“n%d”, k);
return 0;
}
a) 1
b) 0
c) -1
d) 2
Answer:- a
Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW
3. Find the output of the following C code.
a) x1=4, x2=3
b) x1=-5, x2=-4
c) x1=2.5, x2=4.2
d) Roots are imaginary
Answer:- d
4. Find the output of the following code.
a) 6
b) 4
c) 10
d) 14
Answer:- c
5. Which of the following statements are correct?
I. The ‘else’ block is executed when condition inside if statement is false.
II. One ‘if statement can have multiple ‘else’ statement.
a) Only I
b) Only II
c) Both I and II
d) None of the above is correct
Answer:- a
6. Cmodulo division operator %’ can be applied on
a) only float variables
b) only int variables
c) int and float combination
d) any data types in C
Answer:- b
πFor Week 04 Assignment Answersπ
7. The output of the following program will be
a) C programming
b) Java
Python
c) C programming
Java
d) Compilation error
Answer:- b
8. What will be the output?
a) 2
b) 8
c) 10
d) 12
Answer:- For Answer Click Here
9. What will be the output?
a) Right
b) Wrong
c) 0
d) No output
Answer:- a
10. What will be the output of the program?
a) The answer will be 15
b) The answer will be 0
c) The answer will be 1
d) Compilation error
Answer:- b
NPTEL Problem solving through Programming In C Assignment 3 Programming Solutions 2022
Q1. 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.
Code:-
Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW
Q2. Write a C program to check if a given Number is zero or Positive or Negative Using if…else statement.
Code:-
Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW
Q3. Write a C program to check whether a given number (integer) is Even or Odd.
Code:-
Q4. Write a C Program to find the Largest Number (integer) among Three Numbers (integers) using IF and Logical && operator.
Code:-
Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW
For More NPTEL Answers:- CLICK HERE
Join Our Telegram:- CLICK HERE
About Problem Solving Through Programming In C
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
COURSE LAYOUT
- Week 1 : Introduction to Problem Solving through programs, Flowcharts/Pseudo codes, the compilation process, Syntax and Semantic errors, Variables and Data Types
- Week 2 : Arithmetic expressions, Relational Operations, Logical expressions; Introduction to Conditional Branching
- Week 3 : Conditional Branching and Iterative Loops
- Week 4 : Arranging things : Arrays
- Week 5 : 2-D arrays, Character Arrays and Strings
- Week 6 : Basic Algorithms including Numerical Algorithms
- Week 7 : Functions and Parameter Passing by Value
- Week 8 : Passing Arrays to Functions, Call by Reference
- Week 9 : Recursion
- Week 10 : Structures and Pointers
- Week 11 : Self-Referential Structures and Introduction to Lists
- Week 12 : Advanced Topics
CRITERIA TO GET A CERTIFICATE
This course will have an unproctored programming exam also apart from the Proctored exam, please check announcement section for date and time. The programming exam will have a weightage of 25% towards the Final 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.
NPTEL Problem solving through Programming In C Assignment 3 Answers 2022:- We do not claim 100% surety of answers, these answers are based on our sole knowledge, and by posting these answers we are just trying to help students, so we urge do your assignment on your own.
NPTEL Problem Solving Through Programming In C Assignment 3 Answers 2021
Q1.Which of the following statement 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
Ans: (A)
Q2. Find the output of the following C code:
#include <stdio.h>
int main()
{
int a=50, b=20, c=6, d=3, result;
result=a+a*-b/c%d+c*d;
printf("%d",result);
return 0;
}
a) 67
b) -36
c) 66
d) -37
Ans: a) 67
Q3. What is the output of the following C code?
#include <stdio.h>
int main()
{
int h=8;
int b=4*6+3*4<h*5?4:3;
printf("%d\n",b);
return 0;
}
a) 0
b) 3
c) 4
d) Compilation error
Ans:- c) 4
Q4. Find the output of the following C code:
#include <stdio.h>
int main()
{
int x=1;
if((3>5)||(2!=3))
printf("IITKGP\n");
else if(x&=0)
printf("IITD\n");
else
printf("IITM\n");
return 0;
}
a) IITKGP
b) IITD and IITM
c) IITKGP and IITM
d) IITM
Ans: a) IITKGP
Q5. What will be the output?
#include <stdio.h>
int main()
{
if((-10 && 10)||(20 && -20))
printf("Condition is true.");
else
printf("Condition is false.");
return 0;
}
a) Condition is true
b) Condition is false
c) Error
d) No output possible
Ans :- a) Condition is true
Note:- For Question No 1 Answer Join our Telegram Channel
Q6. What is output of the following program?
#include <stdio.h>
int main()
{
int i;
if(i=0,1,2,3)
printf("NPTEL");
else
printf("Programming on c ");
printf("%d\n",i);
return 0;
}
a) Programming on C 0
b) NPTEL 0
c) NPTEL 3
d) Compilation error
Ans:- b) NPTEL 0
Q7. What is output of the program given below?
#include <stdio.h>
int main()
{
int x=0;
if (x++)
printf("true\n");
else if(x == 1)
printf("false\n");
return 0;
}
a) true
b) false
c) Compiler dependent
d) Compiler error
Ans:- b) false
Q8. Which of the following method are accepted for assignment?
a) 8=x=y=z
b) x=8=y=z
c) x=y=z=8
d) None of the above
Ans:- c) x=y=z=8
Q9. What will be the output?
#include <stdio.h>
int main()
{
int a = 100, b = 200, c = 300;
if(c > b > a)
printf("TRUE");
else
printf("FALSE");
return 0;
}
a) TRUE
b) FALSE
c) Syntax Error
d) Compilation Error
Ans:- b) False
Q10. What is the output of the following C code?
#include <stdio.h>
int main()
{
int y = 10;
int z = y +(y == 10);
printf("%d\n", z);
return 0;
}
a) 10
b) 11
c) 20
d) Compiler error
Ans:- b) 11
NPTEL Problem solving through Programming In C Assignment 3 Answers:- We do not claim 100% surety of answers, these answers are based on our sole knowledge, and by posting these answers we are just trying to help students, so we urge do your assignment on your own.
Also Read:-