aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Software Engineering
  • Calculate the vocabulary for the following code: int f=1,...
Multiple choice

Calculate the vocabulary for the following code: int f=1,n=7; for(int i=1; i<=n; i+=i)f*=i;

  1. 11

  2. 15

  3. 10

  4. 05

  5. 11

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Vocabulary is the sum of total number of unique operators and unique operands. unique operators=10('int',',','=',';','for','(','<=','+=',')','*=')unique operands=5(f,1,n,7,i)vocabulary=10+5=15

Keep practicing — related questions

  • Identify the statements that are correct: (A) int a = 13, a>>2 = 3 (B) int b = -8, b>>1 = -4 (C) int a = 13...
  • int y[4] = {6, 7, 8, 9}; int *ptr = y + 2; printf(%dn, ptr[ 1 ] ); /*ptr+1 == ptr[1]*/ What is printed, whe...
  • int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; What value does testarray[2][1][0] in the...
  • int x[] = { 1, 4, 8, 5, 1, 4 }; int *ptr, y; ptr = x + 4; y = ptr - x; What is the value of y in the sample...
  • int i,j; int ctr = 0; int myArray[2][3]; for (i=0; i<3; i++) for (j=0; j<2; j++) { myArray[j][i] = ctr; ++c...
  • int x = 5; int y = 2; char op = '*'; switch (op) { default : x += 1; case '+' : x += y; /*It will go to all...
  • int a [8] = { 0, 1, 2, 3 }; The definition of a above explicitly initializes its first four elements. Which...
  • According to M. N. Srinivas, which of the following are the criterias for determination of a 'dominant cast...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy