1.Which of the following will produce true only if the character cis either a digit or an upper case English letter?  (c >= 0 && c <= 9) || (c >= A && c<= Z) (c >= 0 && c <= 9) || (c >= ‘A’ && c<= ‘Z’) (c >= ‘0’ && c <= ‘9’) || (c >= ‘A’ && c<= ‘Z’) (c >= ‘0’ && c <= ‘9’) && (c >= ‘A’ && c<= ‘Z’)   2.Performing a = upper(c)on a variable that is known to contain a character from 'a' to 'z' is the same as: a = c +’a’-‘A’; a = c +’A’- ‘a’ a = c – ‘A’; a = c – ‘a’;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

 

1.Which of the following will produce true only if the character cis either a digit or an upper case English letter? 

    1. (c >= 0 && c <= 9) || (c >= A && c<= Z)
    2. (c >= 0 && c <= 9) || (c >= ‘A’ && c<= ‘Z’)
    3. (c >= ‘0’ && c <= ‘9’) || (c >= ‘A’ && c<= ‘Z’)
    4. (c >= ‘0’ && c <= ‘9’) && (c >= ‘A’ && c<= ‘Z’)

 

2.Performing a = upper(c)on a variable that is known to contain a character from 'a' to 'z' is the same as:

    1. a = c +’a’-‘A’;
    2. a = c +’A’- ‘a’
    3. a = c – ‘A’;
    4. a = c – ‘a’;

 

3.Which of the following will read a string from a  file with FILE* fpto char myString[81] properly (safely):

    1. fscanf(fp, "%s", myString );
    2. fgets(myString, fp);
    3. fgets(fp, 81, myString); correct : fgets(myString, 81,fp)
    4. fscanf(fp,"%80s", myString);

 

4.If you issue the statement fpIn = fopen("myfile.dat", "a");and dat does not exist, the computer will:

    1. return NULLto fpIn as the file does not exist
    2. create the file in write mode, and position the file pointer at the beginning of the file
    3. create the file in write mode, close the file and return a warning
    4. open a file that most closely resembles the name 'myfile.dat'

5. How many  bytes in the memory will be occupied by short int array[10]

      1. 10 Bytes
      2. 20 Bytes
      3. 40 Bytes
      4. 60 Bytes

 

6.Given the definition void myFunc(int a, int* b , int* c)which statement is true

    1. The values of the aliases a, band c are available to the function
    2. Only the addresses of the variables b, care available to the function
    3. myFunccannot change the variable whose value is copied to a
    4. myFunc can change the value of the variable whose address is copied into b
    5. all of the above

 

7Which of the following is a TRUE statement regarding the strcpy(char * str1, char * str2)function?

 

  1. It copies str2in str1 if str1 has enough space
  2. It adds str2to str1 making a long string
  3. It returns NULL if str1has a shorter length compared to str2
  4. It copies the terminating null after coping the characters from str2to str1

 

8.Give charstr[5]=" "; what is the value of  *(str+1) = str[1]

9.What if I asked for *str + 1= str[0] + 1 = 32 + 1 = 33

Str[0]

32=’ ‘       0

------       ------

  1.     1001

 

  1. 0
  2. ‘0’
  3. space
  4. unknown value

 

10.Give char str[15]="Hello World"; what is the value of

*str and *str+1

‘H’ , ‘H’ + 1

*str and *(str + 1)

  1. ‘H’ and ‘e’
  2. ‘H’ and ‘I’
  3. Address of first and second characters of the string
  4. ‘H’ and ‘f’

 

 

11.Defining char myString[10]=”IPC144” what is the value of
strlen( 1+ myString)
1+ strlen(myString) would be  7

    1. 10
    2. 5 -- correct
    3. 6
    4. 7

 

Expert Solution
steps

Step by step

Solved in 2 steps with 13 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education