W9A1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

13/06/2018 Problem solving through Programming In C - - Unit 10 - Week 9

reviewer1@nptel.iitm.ac.in ▼

Courses » Problem solving through Programming In C

Announcements Course Ask a Question Progress Mentor

Unit 10 - Week 9

Course
outline Week 9 Assignment
The due date for submitting this assignment has passed. Due on 2018-03-28, 23:59 IST.
How to access
the portal Submitted assignment

Week 1 1) What is the output of this C code? 1 point

#include <stdio.h>
Week 2
int main()
{
Week 3
char str[] = "hello, world";
str[5] = '.';
Week 4
printf("%s\n", str);
return 0;
Week 5
}
Week 6
a) hello. world
b) hello, world
Week 7
c) Compile error
Week 8 d) Segmentation fault

No, the answer is incorrect.


Week 9
Score: 0
Feedback for Accepted Answers:
week 9
a) hello. world
Lecture 41:
Substitution of #
2) What is the output of this C code? 1 point
include and
Macro #include <stdio.h>

Lecture 42: int main()


"search" as a {
function
void nptl();
Lecture 43: printf("1 ");
Binary Search nptl();
}
Lecture 44:
void nptl()
Binary Search
(Contd.)
{
printf("2 ");
Lecture 45: }
Sorting
Methods
a) 1 2
W9_PA_Q1 b) Compile time error
W9_PA_Q2 c) 1 2 1 2
d) Depends on the compiler
W9_PA_Q3

W9_PA_Q4
No, the answer is incorrect.
Score: 0
W9_PA_Q5

https://onlinecourses.nptel.ac.in/noc18-cs10/unit?unit=14&assessment=161 1/4
13/06/2018 Problem solving through Programming In C - - Unit 10 - Week 9
W9_PA_Q6 Accepted Answers:
a) 1 2
W9_PA_Q7
3) Property which allows to produce different executable for different platforms in 1 point
W9_PA_Q8
C is called?
W9_PA_Q9
a) File inclusion
Quiz : Week 9
Assignment b) Selective inclusion
c) Conditional compilation
Week 10
d) Recursive macros

Week 11 No, the answer is incorrect.


Score: 0
Week 12 Accepted Answers:
c) Conditional compilation
DOWNLOAD
VIDEOS 4) #include <stdio.h> is called 1 point

a) Preprocessor directive
b) Inclusion directive
c) File inclusion directive
d) None of the mentioned

No, the answer is incorrect.


Score: 0
Accepted Answers:
a) Preprocessor directive

5) C preprocessor is conceptually the first step during compilation 1 point

a) True
b) False
c) Depends on the compiler
d) Depends on the standard

No, the answer is incorrect.


Score: 0
Accepted Answers:
a) True

6) A preprocessor is a program 1 point

a) That processes its input data to produce output that is used as input to another
program
b) That is nothing but a loader
c) That links various source files
d) All of the mentioned

No, the answer is incorrect.


Score: 0
Accepted Answers:
a) That processes its input data to produce output that is used as input to another program
7) What is the output of this C code? 1 point

#include <stdio.h>
#define nptl(m, n) " m ## n "

int main()
{
printf("%s\n", nptl(k, l));
}

https://onlinecourses.nptel.ac.in/noc18-cs10/unit?unit=14&assessment=161 2/4
13/06/2018 Problem solving through Programming In C - - Unit 10 - Week 9

a) k 1
b) k1
c) Compile time error
d) m ## n
No, the answer is incorrect.
Score: 0
Accepted Answers:
d) m ## n
8) What is the output of the following C code 1 point

#include <stdio.h>
#define nptl(x, y) #x #y
int main()
{
printf("%s\n", nptl(k, 1));
return 0;
}

a) k1
b) k 1
c) xy
d) Compile time error

No, the answer is incorrect.


Score: 0
Accepted Answers:
a) k1

9) What is the output of the following C code 1 point

#include <stdio.h>
#define nptl(x, y) x / y + x
int main()
{
int i = -6, j = 3;
printf("%d\n",nptl(i + j, 3));
return 0;
}

a) Divided by zero exception


b) Compile time error
c) -8
d) -4

No, the answer is incorrect.


Score: 0
Accepted Answers:
c) -8

10)What is the output of the following C code? 1 point

#include <stdio.h>
void n();
int main()
{
#define nptl(x, y) x / y + x
n();
}
void n()
{

https://onlinecourses.nptel.ac.in/noc18-cs10/unit?unit=14&assessment=161 3/4
13/06/2018 Problem solving through Programming In C - - Unit 10 - Week 9
printf("%d\n", nptl(-3, 3));
}

a) -8
b) -4
c) Compile time error
d) Undefined behaviour

No, the answer is incorrect.


Score: 0
Accepted Answers:
b) -4

Previous Page End

© 2014 NPTEL - Privacy & Terms - Honor Code - FAQs -


A project of In association with

Funded by

Powered by

https://onlinecourses.nptel.ac.in/noc18-cs10/unit?unit=14&assessment=161 4/4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy