SarkariBix
SarkariBix
Start typing & press "Enter" or "ESC" to close
  • Home
  • Jobs
  • Results
  • Current Affairs
  • GK
  • Online Test
  • HR Interview
  • BLOG

What will the function randomize() do in Turbo C under DOS?

  • Home
  • Computer Science & Engineering
  • C Programming Questions and Answers
  • Library Functions
  • Discuss - 763
1. 

What will the function randomize() do in Turbo C under DOS?

[A]. returns a random number.
[B]. returns a random number generator in the specified range.
[C]. returns a random number generator with a random value based on time.
[D]. return a random number with a given seed value.

Answer: Option C

Explanation:

The randomize() function initializes the random number generator with a random value based on time. You can try the sample program given below in Turbo-C, it may not work as expected in other compilers.

 

/* Prints a random number in the range 0 to 99 */

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

int main(void)
{
    randomize();
    printf("Random number in the 0-99 range: %d\n", random (100));
    return 0;
}
Workspace Report
Leave a Comment

Computer Science & Engineering :: C Programming Questions and Answers : More Exercises

  • Declarations and Initializations
  • Expressions
  • Functions
  • Pointers
  • Strings
  • Input / Output
  • Bitwise Operators
  • Const
  • Variable Number of Arguments
  • Library Functions
  • Control Instructions
  • Floating Point Issues
  • C Preprocessor
  • Arrays
  • Structures, Unions, Enums
  • Command Line Arguments
  • Typedef
  • Memory Allocation
  • Complicated Declarations

Questions & Answers

Aptitude Chemical Engineering Civil Engineering Computer Science & Engineering Current Affairs Data Interpretation Electrical & Electronics Engineering Electronics & Communication Engineering General Knowledge Logical Reasoning Mechanical Engineering Non Verbal Reasoning Verbal Ability Verbal Reasoning

Interviews

HR Interview

Jobs

Sarkari Jobs

Results

Rojgar ResultSarkari Result

Admission

Admission 2022

Admit Card

Admit Card 2022

Answer Key

Answer Key 2022
copyright
Privacy Policy
© 2022 SarkariBix. All Rights Reserved.

Report