Infectious diseases exam, Exams of Public Health

Infectious diseases exam For public health

Typology: Exams

2021/2022

Uploaded on 08/14/2023

faryal-khan-6
faryal-khan-6 🇵🇰

1 document

1 / 125

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Choose the namespace in Choose the namespace in
which the interface IEnumerable is declared?which the interface IEnumerable is declared?
A. A.
System.CollectSystem.Collect
ionsions
C. Both A and BC. Both A and B
D. None of the D. None of the
mentionedmentioned
B. B.
ns.Genericns.Generic
or the !i"en set of code what is output?or the !i"en set of code what is output?
class #ro!ramclass #ro!ram
$$
static static
"oid "oid
%ain&strin!%ain&strin!
'( '(
ar!s)ar!s)
$$
int'( int'(
nums nums
* *
$ $
+, +,
-, -,
/, /,
0, 0,
-1, -1,
2 2
3434
"ar "ar
posNums posNums
* *
nums.5hernums.5her
e&n e&n
*6 *6
n n
7 7
+0).Select&r +0).Select&r
*6 *6
r8/)4r8/)4
Console.5Console.5
rite&9:he rite&9:he
"alues "alues
in in
nums; nums;
9)49)4
foreach foreach
&int &int
i i
in in
posNums) posNums)
Console.5rite&i Console.5rite&i
< <
9 9
9)49)4
Console.5rite=ine&)4 Console.5rite=ine&)4
Console.>ead=ine&)4 Console.>ead=ine&)4
33
33
>un time error>un time error
Compile time errorCompile time error
 -+ 0 0 - + -+ 0 0 - +
+ - 0 0 -+ + - 0 0 -+ 
Choose theChoose the
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Infectious diseases exam and more Exams Public Health in PDF only on Docsity!

Choose the namespace inChoose the namespace in which the interface IEnumerable is declared?which the interface IEnumerable is declared? A.A. System.CollectSystem.Collectionsions C. Both A and BC. Both A and B D. None of theD. None of the mentionedmentioned B.B. System.CollectioSystem.Collections.Genericns.Generic or the !i"en set of code what is output?or the !i"en set of code what is output? class #ro!ramclass #ro!ram $$ staticstatic "oid"oid %ain&strin!%ain&strin!'('( ar!s)ar!s) $$ int'(int'( numsnums ** $$ +,+, -,-, /,/, 0,0, -1,-1, 22 3434 "ar"ar posNumsposNums ** nums.5hernums.5here&ne&n 66 nn 77 +0).Select&r+0).Select&r 66 r8/)4r8/) Console.5Console.5rite&9:herite&9:he "alues"alues inin nums;nums; 9)49) foreachforeach &int&int ii inin posNums)posNums) Console.5rite&iConsole.5rite&i << 99 9)49) Console.5rite=ine&)4Console.5rite=ine&) Console.>ead=ine&)4Console.>ead=ine&) 33 33

un time error>un time error Compile time errorCompile time error  -+ 0 0 - + -+ 0 0 - +

  • - 0 0 -+ + - 0 0 -+  Choose theChoose the

System.:etSystem.:et System.Collections.GenericSystem.Collections.Generic [email protected][email protected]pressions System.=in@System.=in@ or the !i"en set of code what is output?or the !i"en set of code what is output? class #ro!ramclass #ro!ram $$ staticstatic "oid"oid %ain&strin!%ain&strin!'('( ar!s)ar!s) $$ int'( nums * $ +, -, -/, 2int'( nums * $ +, -, -/, 2 3434 "ar "ar posNumsposNums ** fromfrom nn inin numsnums orderbyorderby nn descendin!descendin! selectselect n1n1  4 Console.5 Console.5rite&9:herite&9:he "alues"alues inin nums;nums; 9)49) foreach foreach &int&int ii inin posNums)posNums) Console.5Console.5rite&irite&i << 99 9)49) Console.5rite=ine&)4Console.5rite=ine&) Console.>ead=ine&)4Console.>ead=ine&) 33 33

un time error>un time error +0  -1 -+0  -1 -

  • 2 - -/+ 2 - -/ 2 + - -/2 + - -/

or the !i"en set of code what is output representin!?or the !i"en set of code what is output representin!? class #ro!ramclass #ro!ram $$ staticstatic "oid"oid %ain&strin!%ain&strin!'('( ar!s)ar!s) $$ int'(int'( numsnums ** $$ +,+, -,-, /,/, 0,0, -1,-1, 22 3434 "ar"ar posNumsposNums ** fromfrom nn inin numsnums wherewhere nn 66 00 selectselect n4n intint lenlen ** posNums.CouposNums.Count&)4nt&) Console.5rite=ine&len)4Console.5rite=ine&len) Console.>ead=ine&)4Console.>ead=ine&) 33 33 Eecution of code with nothin! bein! printedEecution of code with nothin! bein! printed

un time error>un time error Eecution of code with countin! total numbers !reater than eroEecution of code with countin! total numbers !reater than ero Eecution of code with printin! all numbersEecution of code with printin! all numbers Select the output for !i"en code snippet;Select the output for !i"en code snippet; class #ro!ramclass #ro!ram $$ static "oid %ain&strin!'( ar!s)static "oid %ain&strin!'( ar!s) $$ int'( nums * $+34int'( nums * $+

"ar posNums * from n in nums where n 6 0 select %ath.%a&F, ) Console.5rite&9:he lar!est "alues in nums; 9) foreach &int i in posNums) Console.5rite&i < 9 9) Console.5rite=ine&) Console.>ead=ine&) 3 3 code run successfully print nothin! Compile time error code run successfully print re@uired output

un time error 5hat will be the output of !i"en code snippet? class #ro!ram $ static "oid %ain&strin!'( ar!s) $ int'( nums * $ +, -, /, 0, -1, 234 "ar posNums * from n in nums where n 6* 0 select n foreach &int i in posNums) Console.5rite&i < 9 9)

un time error code run successfully print nothin! code run successfully print re@uired output Compile time error Select the output for !i"en code snippet; class #ro!ram $ static "oid %ain&strin!'( ar!s) $ int'( nums * $ +, -, /, 0, -1, 2 34 "ar posNums * from n in nums where n 6 -2 HH n 7  orderby n descendin! select n Console.5rite&9Descendin! order in nums; 9) foreach &int i in posNums) Console.5rite&i < 9 9) Console.5rite=ine&) Console.>ead=ine&) 3 3 Compile time error #rint nothin! code run successfully Arran!ed in descendin! order code run successfully

un time error #lease read the @uestions carefully and choose the most appropriate option. 5hich of the !i"en options are :>E about the Strin! Class in CJ.NE:? A strin! built usin! Strin! Class is Immutable. All the listed options A strin! built usin! Strin!Builder Class is %utable. :wo strin!s can be concatenated by usin! an epression of the form s/ * s+ < s #lease read the @uestions carefully and choose the most appropriate option.5hich of the followin! components of the .NE: frameworK pro"ide an etensible set of classes that can be used by any .NE: compliant pro!rammin! lan!ua!e? +..NE: class libraries .Component LbMect %odel only  Both + and  only + None of the listed options :he output of code is? class test $ public "oid print&) $ Console.5rite=ine&9Csharp;9) 3 3

false true Select the output for followin! set of code ; class sample $ public int i public int M public "oid fun&int i, int M) $ this.i * i this.M * M 3 3 class #ro!ram $ static "oid %ain&strin!'( ar!s) $ sample s * new sample&) s.i * + s.M *  s.fun&s.i, s.M) Console.5rite=ine&s.i < 9 9 < s.M) Console.>ead=ine&) 3 3

un successfully but prints nothin!

Error as PthisQ reference would not be able to call PiQ and PMQ Error while callin! s.fun&) due to inaccessible le"el Select output for followin! set of code. class sample $ public int i public int'( arr * new int'+0( public "oid fun&int i, int "al) $ arr'i( * "al 3 3 class #ro!ram $ static "oid %ain&strin!'( ar!s) $ sample s * new sample&) s.i * + sample.fun&+, 2) s.fun&+, 2) Console.>ead=ine&) 3 3 sample.fun&+, 2) will set "alue as 2 in arr'+(

class #ro!ram $ static "oid %ain&strin!'( ar!s) $ sample s * new sample&) s.i * + sample.fun&+, 2) s.fun&+, 2) Console.>ead=ine&) 3 3 sample.fun&+, 2) will not worK correctly s.fun&+, 2) will worK correctly sample.fun&+, 2) will set "alue as 2 in arr'+( s.i * +0 cannot worK as i is PpublicQ Select output for followin! set of code ; CLN:>L= S:>C:>ES static "oid %ain&strin!'( ar!s) $ int  for & * +04  7* +24 <<) while &Con"ert.:oBoolean&Con"ert.:oInt/&))) $ do $

Console.5rite=ine&+) if &Con"ert.:oBoolean& 66 +)) continue 3while &Con"ert.:oBoolean&0)) breaK 3 Console.>ead=ine&) 3 0 0 0R.innite times System outoTow eception error.

            • ;ans
    • +R.innite times Select output for followin! set of code ; static "oid %ain&strin!'( ar!s) $ int i, s * 0, a * +, d i * Con"ert.:oInt/&Console.>ead=ine&)) do $ d * i 8 &  1) s * s < d  a 3while &&Con"ert.:oInt/&i * i  &  1))) U* 0 HH &Con"ert.:oBoolean&Con"ert.:oInt/&&a) * &a  +0))))) Console.5rite=ine&s) Console.>ead=ine&) 3 enter i * /1.

num <*  Console.5rite=ine&num) 3

++ + + ++ +

+ + + + + + 5hat will be the output for !i"en set of code? static "oid %ain&strin!'( ar!s) $

int '(arr * new int'($ +, , /, 1, 234 fun &ref arr) for &int i * 04 i 7 arr.=en!th 4 i<<) Console.5rite=ine& arr'i( < 9 9) 3 static "oid fun&ref int'(a) $ a * new int'( a'/( * / a'+( *  3 0  0 / 0 0 0 0 / 0 0 0  0

5hat will be the correct output for !i"en code snippet? class maths $ public int fact&int n) $ int result if &n ** +) return + result * fact&n - +)  n return result 3 3 class Lutput $ static "oid %ain&Strin!'( ar!s) $ maths obM * new maths&) 4 Console.5rite=ine&obM.fact&1)obM.fact&)) 3 3  1F  + 5hich method does followin! set of code eplains? static "oid %ain&strin!'( ar!s)

int a * +0, b *  method&ref a, ref b) console.writeline&a < 9 9 < b) 3 static "oid swap&ref int i, ref int M) $ int t t * i i * M M * t 3 Call by reference Call by "alue parameter arrays Lutput parameter 5hat will be the correct output for !i"en code snippet? class maths $ public int fact&int n) $ int result if &n ** +) return + result * fact&n - +)  n return result