CPP

CPP

Locale has 9 Questions
What is the main feature of locale in C++?

Sustanability
Portability
Reliability
None of the mentioned
Which objects information is loaded in locale object?

facet object
instead object
Both a & b
None of the mentioned
How many categories are available in facets?

4
5
6
3
What is the output of this program?
  1.     #include  
  2.     #include 
  3.     int main ()
  4.     {
  5.         int i = 0;
  6.         char str[] = "Steve Jobs\n";
  7.         char c;
  8.         while (str[i])
  9.         {
  10.             c = str[i];
  11.             if (islower(c)) 
  12.                 c = toupper(c);
  13.             putchar (c);
  14.             i++;
  15.         }
  16.         return 0;
  17.     }

Steve jobs
STEVE JOBS
Steve
None of the mentioned
What is the output of this program?
  1.     #include 
  2.     #include 
  3.     int main ()
  4.     {
  5.         int i;
  6.         char str[] = "jobs...";
  7.         i = 0;
  8.         while ( isalnum(str[i] )) 
  9.             i++;
  10.         printf (" %d\n",i);
  11.         return 0;
  12.     }

1
2
3
4
What is the output of this program?
  1.     #include 
  2.     #include 
  3.     #include 
  4.     int main ()
  5.     {
  6.         char str[] = "ffff";
  7.         long int number;
  8.         if (isxdigit(str[0]))
  9.         {
  10.             number = strtol (str, NULL, 16);
  11.             printf ("%ld\n", number);
  12.         }
  13.         return 0;
  14.     }

64345
21312
65535
Error
What will the monetary facet will do?

Handle formatting and parsing of monetary values
Handle formatting and parsing of character values
Both a & b
None of the mentioned
What kind of locale does every program is having in C++?

local locale
global locale
temp locale
None of the mentioned
What is the output of this program?
  1.     #include 
  2.     #include 
  3.     int main ()
  4.     {
  5.         int i = 0;
  6.         int cx = 0;
  7.         char str[] = "Hello, welcome!";
  8.         while (str[i])
  9.         {
  10.             if (ispunct(str[i])) cx++;
  11.                 i++;
  12.         }    
  13.         printf ("%d\n", cx);
  14.         return 0;
  15.     }

1
2
3
4