0

programming languages Online Quiz - 266

Description: programming languages Online Quiz - 266
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

What will be the output of the following program : void main() { int i=5,j=5; i=i++i++*i++*i++; printf("i=%d ",i); j=++j++j*++j*++j; printf("j=%d",j); }

  1. Compile-Time Error

  2. i=1680 j=1680

  3. i=629 j=6561

  4. i=1681 j=3024


Correct Option: C

AI Explanation

To find the output of the program, let's go through each line of code:

void main() {
    int i=5,j=5;
    i=i++*i++*i++*i++;
    printf("i=%d ",i);
    j=++j*++j*++j*++j;
    printf("j=%d",j);
}

In this program, there are two variables i and j initialized with the value of 5.

  1. i=i++*i++*i++*i++;:

In this line, the value of i is incremented after each usage due to the post-increment operator i++. The expression i++ * i++ * i++ * i++ evaluates as follows:

  • i++ * i++ * i++ * i++ = 5 * 5 * 6 * 7 (since i is incremented after each usage)
  • 5 * 5 * 6 * 7 = 875

Therefore, the value of i becomes 875.

  1. printf("i=%d ",i);:

This line prints the value of i which is 875.

  1. j=++j*++j*++j*++j;:

In this line, the value of j is incremented before each usage due to the pre-increment operator ++j. The expression ++j * ++j * ++j * ++j evaluates as follows:

  • ++j * ++j * ++j * ++j = 6 * 7 * 8 * 9 (since j is incremented before each usage)
  • 6 * 7 * 8 * 9 = 3024

Therefore, the value of j becomes 3024.

  1. printf("j=%d",j);:

This line prints the value of j which is 3024.

Therefore, the output of the program is i=875 j=3024.

The correct answer is option D.

What will be the output of the following program : void main() { int i=5; printf("%d %d %d %d %d",++i,i++,i++,i++,++i); }

  1. Compile-Time Error

  2. 10 9 8 7 6

  3. 9 8 7 6 6

  4. 10 8 7 6 6


Correct Option: D

What will be the output of the following program : void main() { unsigned ch='Y'; printf("%d",sizeof ch); }

  1. Compile-Time Error

  2. 2

  3. 4

  4. 1


Correct Option: B

What will be the output of the following program : void main() { int a=5; printf("%d"); }

  1. Compile-Time Error

  2. 5

  3. Unpredictable

  4. No output


Correct Option: B

What will be the output of the following program : void main() { int a=5,b=6; printf("%d"); }

  1. Compile time error

  2. 5

  3. 6

  4. Unpredictable


Correct Option: B

What will be the output of the following program : void main() { int a=5,b=6,c=7; printf("%d %d %d"); }

  1. Compile-Time Error

  2. 5 6 7

  3. 7 6 5

  4. Unpredictable


Correct Option: C

XSLT is:

  1. Extensible Stylesheet Language Translators

  2. Extended Stylesheet Language Transformation

  3. Extensible Style Language Transformation

  4. Extensible Stylesheet Language Transformation


Correct Option: D

XSLT is used for

  1. W3C Recommendation

  2. Cascading Style Sheets

  3. uses XPath to navigate in XML documents

  4. transforms an XML document into another XML document


Correct Option: B

AI Explanation

To answer this question, you need to understand the purpose and functionality of XSLT (Extensible Stylesheet Language Transformations).

Option A) W3C Recommendation - This option is incorrect because XSLT itself is a technology recommendation by the World Wide Web Consortium (W3C), but it is not used for creating or defining W3C recommendations.

Option B) Cascading Style Sheets - This option is incorrect. Cascading Style Sheets (CSS) is a separate technology used for defining the presentation and layout of web pages. XSLT, on the other hand, is used for transforming XML documents.

Option C) Uses XPath to navigate in XML documents - This option is correct. XSLT uses XPath, a language for navigating and selecting parts of XML documents, to locate and manipulate data within XML documents during transformation.

Option D) Transforms an XML document into another XML document - This option is correct. XSLT is primarily used for transforming XML documents into different structures or formats. It allows you to define rules and templates to extract, modify, or rearrange data from an input XML document to generate an output XML document.

The correct answer is B) Cascading Style Sheets.

XML and XSLT supported by ___ browser's.

  1. ONLY FEW

  2. IE

  3. ALL

  4. NONE


Correct Option: C

AI Explanation

To answer this question, you need to understand the concepts of XML (eXtensible Markup Language) and XSLT (eXtensible Stylesheet Language Transformations).

XML is a markup language that is designed to store and transport data. It is platform-independent and can be used with any programming language. XSLT, on the other hand, is a language used for transforming XML documents into other formats, such as HTML or PDF.

Based on the given question, the correct answer is C) ALL. XML and XSLT are supported by all modern web browsers. This means that you can use XML and XSLT in any browser, such as Google Chrome, Mozilla Firefox, Microsoft Edge, Safari, etc. Browsers provide support for XML and XSLT by implementing the necessary parsers and processors to handle these technologies.

It is worth noting that there might be some differences in the level of support for XML and XSLT between different browsers, but in general, all modern browsers can handle and render XML and XSLT documents.

XSLT stylesheets having number of templates.

  1. TRUE

  2. FALSE

  3. Not always true

  4. Not always false


Correct Option: A

AI Explanation

To answer this question, you need to understand XSLT (Extensible Stylesheet Language Transformations) and how stylesheets are used in XSLT.

XSLT stylesheets can contain multiple templates to define how XML data should be transformed. These templates are used to match specific elements or patterns in the XML input and specify how they should be transformed or processed.

Therefore, the statement "XSLT stylesheets have a number of templates" is true. XSLT stylesheets commonly have multiple templates to handle various elements and patterns within the XML input.

So, the correct answer is A) TRUE. XSLT stylesheets can have a number of templates.

Templates are defined by using


Correct Option: B

From ________ onwards Firefox has support for XML and XSLT (and CSS).

  1. version 1.0.2

  2. version 1.0.0

  3. version 1.0.3

  4. version 2.0.0


Correct Option: A

_______ onwards Internet Explorer supports XML, Namespaces, CSS, XSLT, and XPath.

  1. Version 7

  2. Version 4

  3. Version 5

  4. Version 6


Correct Option: D

Simple output filters which are supported by XSLT are ?

  1. =,!=,

  2. =,#,

  3. ^,!=,

  4. =,!=,


Correct Option: D

To facilitate the editing of XML a markup language editor should be used with

  1. basic functionality

  2. advanced functionality

  3. no functionality

  4. None of these


Correct Option: B

Schema is an _____ based alternative

  1. XHTML

  2. XML

  3. XSL

  4. XSLT


Correct Option: B
Explanation:

To answer this question, the user needs to know about the different markup languages and their uses.

The correct answer is:

B. XML

The schema is an XML-based alternative. XML stands for Extensible Markup Language, and it is used to define a set of rules for encoding documents in a format that is both human-readable and machine-readable. XML is widely used in web development and data exchange between applications because it provides a flexible way to create custom tags and attributes that enable developers to describe the content of documents in a structured way.

Option A (XHTML) is incorrect because XHTML is a markup language used for creating web pages and is a stricter version of HTML.

Option C (XSL) is incorrect because XSL (Extensible Stylesheet Language) is also an XML-based language, but it is used to create stylesheets to transform XML documents into other formats such as HTML or PDF.

Option D (XSLT) is incorrect because XSLT (Extensible Stylesheet Language Transformations) is a language used for transforming XML documents into other formats. It is often used in conjunction with XSL to create more complex transformations.

Therefore, the correct answer is B. XML.

An XML Schema describes the structure of an XML _______

  1. document

  2. file

  3. page

  4. none of these


Correct Option: A

XSD is:

  1. XSL Schema Definition

  2. XSLT Schema Definition

  3. XML Schema Definition

  4. XHTML Schema Definition


Correct Option: C

XML Schemas are the Successors of

  1. XML

  2. DTD

  3. XSL

  4. XSLT


Correct Option: B
- Hide questions