Consider the following program
: #include<stdio.h>
main()
{
int i, inp;
float x, term=1, sum=0;
scanf(“%d %f”,&inp, &x);
for(i=1;i<=inp;i++)
{
term=term*x/i;
sum=sum+term;
}
printf(“Result=%f\n”,sum);
}
The program computes the sum of which of the following series?
A. | x+x 2 /2+x 3 /3+x 4 /4+... |
B. |
x+x 2 /2!+x 3 /3!+x 4 /4!+...
|
C. | 1+x 2 /2+x 3 /3+x 4 /4+... |
D. | 1+x 2 /2!+x 3 /3!+x 4 /4!+... |
Option: B Explanation : Click on Discuss to view users comments. |
A. | Both the statements (a) and (b) are correct |
B. | Neither of the statements (a) and (b) are correct |
C. | Statement (a) is correct and (b) is incorrect |
D. | Statement (a) is incorrect and (b) is correct |
Option: A Explanation : Click on Discuss to view users comments. |
Consider a “CUSTOMERS” database table having a column “CITY” filled with all the names of Indian cities (in capital letters). The SQL statement that finds all cities that have “GAR” somewhere in its name, is:
A. | Select *from customers where city=’%GAR%’; |
B. | Select *from customers where city=’$GAR$’; |
C. | Select *from customers where city like ‘%GAR%’; |
D. | Select *from customers where city as ’%GAR’; |
Option: C Explanation : Click on Discuss to view users comments. |
Match the following database terms to their functions:
List - I | List - II |
(a) Normalization | (i) Enforces match of primary key to foreign key |
(b) Data Dictionary | (ii) Reduces data redundancy in a database |
(c) Referential Integrity | (iii) Define view(s) of the database for particular user(s). |
(d) External Schema | (iv) Contains metadata describing database structure. |
Codes: | ||||
(a) | (b) | (c) | (d) | |
(A) | (iv) | (iii) | (i) | (ii) |
(B) | (ii) | (iv) | (i) | (iii) |
(C) | (ii) | (iv) | (iii) | (i) |
(D) | (iv) | (iii) | (ii) | (i) |
A. | (iv) (iii) (i) (ii) |
B. | (ii) (iv) (i) (iii) |
C. | (ii) (iv) (iii) (i) |
D. | (iv) (iii) (ii) (i) |
Option: B Explanation : Click on Discuss to view users comments. |
A. |
Both time and space complexities are better in recursive than in non-recursive program
|
B. |
Both time and space complexities are better in non-recursive than in recursive program
|
C. |
Time complexity is better in recursive version but space complexity is better in non-recursive version of the program
|
D. |
Space complexity is better in recursive version but time complexity is better in non-recursive version of the program
|
Option: C Explanation : Click on Discuss to view users comments. |