Point out error, if any, in the following program
main()
{
int i=1;
switch(i)
{
case 1:
printf("nRadioactive cats have 18 half-lives");
break;
case 1*2+4:
printf("nBottle for rent -inquire within");
break;
}
}
No error. Constant expression like 1*2+4 are acceptable in cases of a switch.
Point out the error, if any, in the following program
main()
{
int a=10,b;
a>= 5 ? b=100 : b=200;
printf("n%d",b);
}
lvalue required in function main(). The second assignment should be written in parenthesis as follows:
a>= 5 ? b=100 : (b=200);
What would be the output of the following program?
main()
{
int i=4;
switch(i)
{
default:
printf("n A mouse is an elephant built by the Japanese");
case 1:
printf(" Breeding rabbits is a hair raising experience");
break;
case 2:
printf("n Friction is a drag");
break;
case 3:
printf("n If practice make perfect, then nobody's perfect");
}
}
a) A mouse is an elephant built by the Japanese b) Breeding rabbits is a hare raising experience
c) All of the above
What is the output of the following program?
#define SQR(x) (x*x)
main()
{
int a,b=3;
a= SQR(b+2);
printf("%d",a);
}
a) 25 b) 11 c) error d) garbage value
In which line of the following, an error would be reported?
1. #define CIRCUM(R) (3.14*R*R);
2. main()
3. {
4. float r=1.0,c;
5. c= CIRCUM(r);
6. printf("n%f",c);
7. if(CIRCUM(r))==6.28)
8. printf("nGobbledygook");
9. }
a) line 1 b) line 5 c) line 6 d) line 7
What is the type of the variable b in the following declaration?
#define FLOATPTR float*
FLOATPTR a,b;
a) float b) float pointer c) int d) int pointer
In the following code;
#include
main()
{
FILE *fp;
fp= fopen("trial","r");
}
fp points to:
a) The first character in the file.
b) A structure which contains a "char" pointer which points to the first character in the file.
c) The name of the file. d) None of the above.
If the program (myprog) is run from the command line as myprog 1 2 3 , What would be the output?
main(int argc, char *argv[])
{
int i;
for(i=0;i
If the following program (myprog) is run from the command line as myprog 1 2 3, What would be the output?
main(int argc, char *argv[])
{
int i,j=0;
for(i=0;i
If the following program (myprog) is run from the command line as myprog monday tuesday wednesday thursday,
What would be the output?
main(int argc, char *argv[])
{
while(--argc >0)
printf("%s",*++argv);
}
a) myprog monday tuesday wednesday thursday b) monday tuesday wednesday thursday
c) myprog tuesday thursday d) None of the above
Querying Data with Oracle XQuery | |
Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat |
|
Performing DML Operations on XML Schema Based XMLType Views | |
Performing DML Operations on XML Schema Based XMLType Views Analyzing the underlying query of the empSch v view discussed in the preceding section you may note that each attribute of the EMP T object used in the select list maps to a certain column of a single table namely emps What this means in pr |
|
Using XMLType Views | |
Using XMLType Views Using XMLType Views XMLType views provide a convenient way to construct XML representations of relational data without physically migrating that data into XML Once written an XMLType view may be used in various queries making them simpler and so increasing their readability mosgo |
|
Using XMLType for Handling XML Data in the Database | |
Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM |
|
Performing XSLT Transformations inside the Database | |
Performing XSLT Transformations inside the Database Now that you have the employees XSL stylesheet stored in the database and the xmlusr schema is permitted to access the hr employees table you can create a script that will instruct the database to build an HTML page based on the data stored in hr e |
|
Transforming and Processing XML with XSLT | |
Transforming and Processing XML with XSLT In the preceding example you transform XML into HTML directly in your script wrapping the data extracted from the XML document into appropriate HTML tags Alternatively you might perform an XSL Extensible Stylesheet Language transformation to get the same gen |
|
Querying a DOM Document with XPath | |
Querying a DOM Document with XPath One way to access the DOM tree in a DOMDocument object is through an associated DOMXPath object Identifying a specifi c node or nodes within the DOM tree of a DOMDocument object with this approach involves use of appropriate XPath expressions passed to the DOMXPath |
|
C++ Standard Input Output Stream | |
C Standard Input Output Stream In this C tutorial you will learn about standard input stream and standard output stream explained along with syntax and examples C programming language uses the concept of streams to perform input and output operations using the keyboard and to display information on |
|
How to define command line arguments | |
The main functions can have arguments passed which are called as command line arguments. There are two command line arguments:
Argument count denoted by argc and
Argument vector denoted by argv
The argc is an integer variable which denotes the number of parameters passed and argv is pointer to a |
|
How to develop compile and run a C program | |
The steps involved in building a C program are:
1. First program is created by using any text editor and the file is stored with extension as .c
2. Next the program is compiled. There are many compilers available like GNU C compiler called as gcc, Sun compiler, Borland compiler which is pop |
|
|