Languages-C & C Plus Plus [TCS Placement]: Sample Questions 83 - 85 of 119

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 83

C & C Plus Plus
Edit

Describe in Detail

Essay▾

Which of the following statements should be used to obtain a remainder after dividing 7.14 by 3.1?

Explanation

  • fmod (x, y) - Calculates x modulo y, the remainder of x/y.
  • This function is the same as the modulus operator but also performs floating-point divisions.
  • Example:
  1. #include<stdio.h>
  2. #include<math.h>
  3. intmain ()
  4. {
  5.     printf ("fmod of 7.14/3.1 is %lf", fmod (7.14,3.1) );
  6.     return0;
  7. }
  • Output:

Fmod of 7.14/3.1 is 0.940000

Question 84

C & C Plus Plus
Edit

Describe in Detail

Essay▾

What is hashing?

Explanation

  • Hashing algorithm converts data into random-looking integer.
  • Hashing is the process of generating a number or a unique string for a (large) message.
  • Ideal hashing aims to produce unique output from unique inputs and there should be no way to reproduce original message from hash value.
  • Hashing can be used on data with no inherent ordering (such as images) or on data which is expensive to compare (such as images) .
Given the Image is Define the Hash Function

Question 85

C & C Plus Plus
Edit

Describe in Detail

Essay▾

What is an IL?

Explanation

  • Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or CIL (Common Intermediate Language) to which all . NET source code is compiled to.
  • IL is converted to machine code when software is installed, or at run-time by a Just-In-Time (JIT) compiler.
  • Intermediate language (IL) is object-oriented programming language used by compilers for the . NET Framework for static or dynamic compilation to machine code.
  • IL is the machine-independent code- output of compilation of the source code written in any . NET programming language.
  • IL is a stack-based assembly language that gets converted to byte code during execution of a virtual machine.
  • It is defined by the common language infrastructure (CLI) specification.
  • As IL is used for automatic generation of compiled code, there is no need to learn its syntax.
Given the Image is Define the Intermediate Language (IL)

Developed by: