1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Shalnov [3]
4 years ago
13

In java, c or c++ code, when a number begins with a leading 0, what do you know about that number: (example: int zzz = 012;) in

java, c or c++ code, when a number begins with a leading 0x, what do you know about that number: (example: int zzz =0x12;) in java, c or c++ code, when a number begins without a prefix, what do you know about that number: (example: int zzz =12;)
Computers and Technology
1 answer:
Katarina [22]4 years ago
5 0
A leading 0 denotes octal notation, so the digits 8 and 9 are not used.
In normal decimal notation 12 means 1*10+2, in octal, it means 1*8+2.

The leading 0x denotes hexadecimal notation, here the digits are extended with 6 letters, a through f. 0x12 means 1*16+2.

Without any prefix, we have normal decimal notation.
You might be interested in
In this assignment you'll write a program that encrypts the alphabetic letters in a file using the Vigenère cipher. Your program
solniwko [45]

Answer:

C code is given below

Explanation:

// Vigenere cipher

#include <ctype.h>

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

/**

* Reading key file.

*/

char *readFile(char *fileName) {

   FILE *file = fopen(fileName, "r");

   char *code;

   size_t n = 0;

   int c;

   if (file == NULL) return NULL; //could not open file

   code = (char *)malloc(513);

   while ((c = fgetc(file)) != EOF) {

      if( !isalpha(c) )

          continue;

      if( isupper(c) )

          c = tolower(c);

      code[n++] = (char)c;

   }

   code[n] = '\0';

  fclose(file);

   return code;

}

int main(int argc, char ** argv){  

   // Check if correct # of arguments given

   if (argc != 3) {

       printf("Wrong number of arguments. Please try again.\n");

       return 1;

   }

 

  // try to read the key file

  char *key = readFile(argv[1]);

  if( !key ) {

      printf( "Invalid file %s\n", argv[1] );

      return 1;

  }

 

  char *data = readFile(argv[2]);

  if( !data ) {

      printf("Invalid file %s\n", argv[2] );

      return 1;

  }

 

   // Store key as string and get length

   int kLen = strlen(key);

  int dataLen = strlen( data );

 

  printf("%s\n", key );

  printf("%s\n", data );

 

  int paddingLength = dataLen % kLen;

  if( kLen > dataLen ) {

      paddingLength = kLen - dataLen;

  }

  for( int i = 0; i < paddingLength && dataLen + paddingLength <= 512; i++ ) {

      data[ dataLen + i ] = 'x';

  }

 

  dataLen += paddingLength;

 

   // Loop through text

   for (int i = 0, j = 0, n = dataLen; i < n; i++) {          

       // Get key for this letter

       int letterKey = tolower(key[j % kLen]) - 'a';

     

       // Keep case of letter

       if (isupper(data[i])) {

           // Get modulo number and add to appropriate case

           printf("%c", 'A' + (data[i] - 'A' + letterKey) % 26);

         

           // Only increment j when used

           j++;

       }

       else if (islower(data[i])) {

           printf("%c", 'a' + (data[i] - 'a' + letterKey) % 26);

           j++;

       }

       else {

           // return unchanged

           printf("%c", data[i]);

       }

      if( (i+1) % 80 == 0 ) {

          printf("\n");

      }

   }

 

   printf("\n");

 

   return 0;

}

4 0
3 years ago
Read 2 more answers
Untuk memberikan keterangan pada bagian bawah halaman dokumen yg akan diulangi pada setiap halaman dokumen yg digunakan fasilita
lisabon 2012 [21]
Fasilitas yg di gunakan adalah footer
5 0
3 years ago
Read 2 more answers
Editing is the process of cutting out the bad parts. True or false?
Maurinko [17]

Answer:

true

Explanation:

your welcome

7 0
3 years ago
Read 2 more answers
What are rules that we use on the internet called, and what are some of them?
dusya [7]
Like safety rules like what to do privacy, plagarizim, and  cyberbullying and what not. Just stuff like that.
5 0
3 years ago
Module 1 and 2 Coding Guided Notes Fill in your answers to each response as you read through the lesson pages in the coding cour
creativ13 [48]

Answer:

Code; code; program.

Explanation:

1. Instructions for computers to solve a problem is known as code. Computer code is how humans and machines talk to each other. Some examples of programming language used to write a code in instructing a computer for the execution of a task are python, Java, Javascript, ruby, c++, c# etc.

2. Learning to code or write a program allows for a solution to a problem.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Exchanging which type of data uses the least bandwidth?
    14·1 answer
  • Which of these can be considered data?
    14·2 answers
  • Write a note on secondary storage​
    14·1 answer
  • A flowchart that depicts the relationships among the input, processing, and output of an AIS is
    6·1 answer
  • The hotspot created by MiFi is password protected and can be used to connect Wi-Fi devices located within ____ feet of the MiFi
    9·1 answer
  • Differentiate between the broadcasting and telecommunication
    5·1 answer
  • What does the somaliland high population density <br>​
    15·1 answer
  • Write a program that prompts the user for an integer and then prints all prime numbers up to that integer.
    7·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    12·1 answer
  • Hide Time Remaining A
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!