W9A1
W9A1
W9A1
reviewer1@nptel.iitm.ac.in ▼
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
#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
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
a) Preprocessor directive
b) Inclusion directive
c) File inclusion directive
d) None of the mentioned
a) True
b) False
c) Depends on the compiler
d) Depends on the standard
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
#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
#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;
}
#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
Funded by
Powered by
https://onlinecourses.nptel.ac.in/noc18-cs10/unit?unit=14&assessment=161 4/4