Monday, 20 September 2021

HTML - TEST ANSWER (Spoken Tutorials)

 

HTML - TEST

 01.  HTML output can be seen in a                                                                                                      

 Ans : Web Browser

02. dl stands for

Ans : Both (Definition list, Description list)

03. Title attribute will create a __________.

Ans : Tooltip for the element

04. li stands for _______________-

Ans : list item

05. We can specify the colour in the form of

Ans : All of these (HEX values, Colour name, RGB values)

06. th stands for

Ans : Table heading

07 : < will generate

Ans : Less than symbol

08 : Attribute values containing spaces have to be entered within

Ans : Both (Single quotes, Double quotes)

09. Heading tag has ___ levels

Ans : 6

10. HTML Tags are case sensitive.

Ans : False

11. We can add multiple style attributes for a single tag.

Ans : True

12. We cannot create a list inside another list.

Ans : False

13. Which one of the below HTML code is written correctly?

Ans : <p> <b> My Topic </b> <i> My text </i> </p>

14. The space between the cells is defined with the help of

Ans : Border Spacing

15. If the source audio or video is not supported by the browser, it will display

Ans : An empty player

16. HTML Element is a

Ans : Collection of Tags and Contents

17.  <a> is an

Ans : anchor tag

18. We can include the script file with the help of

Ans : <script>

19. WYSIWYG stands for

Ans : What You See is What You Get

20. Square shape bullet point can be created with the help of

Ans : Unordered list

21. __________ tag will create a line break.

Ans : <br>

22. img src stands for

Ans : Image source

23. wav audio will only play in the Internet Explorer web browser.

Ans : False

24. We can have more than one attribute for an Element.

Ans : True

25. <input type="text" name="fname" value="sample" alt= "Empty Form">

       This will create an

Ans : Editable Textbox filled with the text sample

26. The following syntax is for

       <dl> <dt> Name 1</dt> <dd> value 1 </dd> <dt> Name 2 </dt> <dd> value 1 </dd> <dd> value 2 </dd> </dl>

Ans : Definition list

 27. The ____ tag will help search engines to display our page in the search result.

Ans : <meta>

28. ________ is used to comment a line.

Ans : <! … ->

29. ____________ element feature is similar to Google search.

Ans : Datalist

30. <legend> tag is used to

Ans : Give a name for the fieldset

31. Image map is used to

Ans : Select specific area in the image

32. Which one is not a style property?

Ans : text-bf

33. CSS is a

Ans : External style sheet

34. We can add multiple style attributes with the help of

Ans : Semicolon

35. id, href and class are

Ans : Attributes

36. ______ element is used to perform an action when it is clicked.

Ans : Button

37. CSS Stands for

Ans : Cascading Style Sheet

38. We can include styles in our HTML document via

Ans : All of these options (External Style Sheet, Style tag, Tag attribute)

39. The form Attribute ________ compels the user to fill the field, without skipping it.

Ans : Required


HTML - TEST | BY :- NISHANT KUMAR

 

C++ TEST ANSWER (Spoken Tutorials)

 

CPP - test

 01. Which format specifier will be used to provide precision of 4 digits after decimal point?

Ans : %.4f

02. Which of  the following variable can store the address of a variable?

Ans : Pointer variable

03. Which of he following accesses the 7th element stored in array?

Ans : array[6];

04. Which of the following mode opens file for reading?

Ans : r

05. What is the format specifier for "double" data-type?

Ans : %lf

06. what will be the output of the following program?

       #include <iostream>

       using namespace std;

       int main()

           {

            int x, y;

            x = 5;

            y = x++ * ++x;

            cout << x <<" " << y;

            return 0;

           }

Ans : 7 35

07. Which of the following is the correct postfix form?

Ans : a++

08. Which of the following is a logical operator in C++?

Ans : ||

 09 : Which of the following statements initializes the pointer to the address of x variable?

Ans : int *ptr=&x;

10. What will be the output of the following program?

      #include <iostream>

      using namespace std;

      int main()

          {

             char *ptr;

             char Str[] = "abcdefg";

             ptr = Str;

             ptr += 4;

             cout << ptr;

             return 0;

           }

Ans : efg

11. How many times is a constructor called in the life-time of an object?

Ans : Only once

12. What is the index number of the last element of an array with 9 elements?

Ans : 8

13. What will be the output of the following program?

      #include <iostream>

      using namespace std;

      int main ()

         {

          int array[] = {0, 2, 4, 6, 7, 5, 3};

          int n, result = 0;

          for (n = 0 ;n < 5 ;n++)

            {

             result += billy[n];

             }

          cout << result;

          return 0;

          }

Ans : Compilation error

14. What will be the output of the following program?

      #include <iostream>

      using namespace std;

          int main()

              {

                  int x = -1;

                  int y = -3.3;

              if(x > y)

                 {

                      cout << "x is greater";

                 }

              else

                {

                     cout << "y is greater";

               }

        }

Ans : x is greater

15. Which of the following is used to make a variable of one type behave like another type.

Ans : Typecasting

16. Which of the following is used to accept a character from a file?

Ans : getchar

17. How many times is a constructor called in the life-time of an object?

Ans : Only once

18. What is the result of a relational operator?

Ans : either true or false

19. If a function does not have return type, it is declared as _____________.

Ans : void

20. Which of the following is the correct postfix form?

Ans : a++

21. Which format specifier will be used to provide precision of 4 digits after decimal point?

Ans : %.4f

22. Which function must not use a return statement?

Ans : void

23. Which of the following variables is enclosed in single quotes?

Ans : character variable

24. What will be the output of the following program?

#include <iostream>

using namespace std;

int main()

    {

     int a = 8;

     cout << "Integer 'a' with 'true' :" << a && true;

     return 0;

    }

Ans : Integer 'a' with 'true' :8

25. What will be the output of the following program?

#include <iostream>

using namespace std;

int array1[] = {1200, 200, 2300, 1230, 1543};

int array2[] = {12, 14, 16, 18, 20};

int temp, result = 0;

int main()

   {

    for (temp = 0; temp < 4; temp++)

    {

     result += array1[temp];

    }

    for (temp = 0; temp < 5; temp++)

    {

     result += array2[temp];

    }

    cout << result;

    return 0;

   }

Ans : 5010

26. Which of the following statement is correct?

Ans :-

1. Constructor has the same name as that of the class.

2. Destructor has the same name as that of the class with a tilde symbol at the beginning.

27. In C++ language, which of the following is not an integer value?

Ans :-

'22'

'A'

28. Select the missing code lines from the dropdown provided.

The  C++ code given below should swap two numbers entered by user.

But, line numbers 8 and 16 are missing.

 

1  #include <iostream>

2  using namespace std;

3  int swap(int &x, int &y)

4  {

5    int t;

6    t = x;

7    x = y;   

8    ---------------Missing code -------------------

9   } 

10  int main ()

11  {

12   int a,b;

13   cout<< "Enter values of a and b\n";

14   cin>> a>>b;

15   cout << "Before swapping a and b : " <<a <<" and " <<b <<"\n";

16   ---------------Missing code -------------------

17   cout << "After swapping a and b : " << a <<" and " <<b <<"\n";

18   return 0;

19  }

Ans :-

Line 8 :-   y = t;

Line 16 :-  swap(a, b);

29. What is the break statement used for?

Ans : To interrupt the normal flow of control of a program

30. What will be the output of the following program?

#include <iostream>

using namespace std;

int main()

   {

    int i = 3;

    int l = i / -2;

    int k = i % -2;

    cout << l  << " "  << k;

    return 0;

   }

Ans :  -1 1

31. Which of the following marks the end of executable statements?

Ans : return 0;

32. Which of the following signifies new line?

Ans : \n

33. Which of the following accesses the 7th element stored in array?

Ans : array[6];

34. Point out the error line in the following program.

1        #include <iostream>

2        using namespace std;

3        int main()

4        {

5            int array[] = (10, 20, 30);

6            cout << -array[2];

7            return 0;

8        }

Ans : Line number 5


CPP - TEST | BY :- NISHANT KUMAR

 

 

Saturday, 11 September 2021

C-TEST (Spoken Tutorial)

C-TEST

01. Which one of the following declarations is correct?

Ans : int length;

02. What is the output of the following program?

 

#include<stdio.h>

 int main()

 {

     struct emp

     {

         char name[20];

         int age;

         float sal;

     };

     struct emp e = {"Tiger"};

     printf("%d, %f", e.age, e.sal);

     return 0;

 }

Ans : 0, 0.000000

03. What will be the output of the following program?

 

#include<stdio.h>

 int main()

 {

     int x = 10, y = 20;

     if(x+y > y)

         printf("x = %d\n", x);

     else

         printf("y = %d", y);

     return 0;

 }

Ans : x = 10

04. We declare a function with ______ if it does not have any return type.

Ans : void

05. What will be the output of the following program?

 

#include<stdio.h>

 int check (int, int);

 int main()

 {

     int c;

     c = check(10, 20);

     printf("c=%d", c);

     return 0;

 }

 int check(int i, int j)

 {

     int *p, *q;

     p=&i;

     q=&j;

     i>=45 ? return(*p): return(*q);

 }

Ans : Will give a compile error

 06. Which of the following is the correct postfix operation?

Ans : a++

07. Which of the following marks the end of executable statements?

Ans : return 0;

08. What will be the output of the following program?

 

#include<stdio.h>

 int X=40;

 int main()

 {

     int X=20;

     printf("%d", X);

     return 0;

 }

Ans : 20

09. Which keyword is used to transfer control from a function back to the calling function?

Ans : return

10. What does the return 0; statement in main function indicate?

Ans : The program worked as expected, without any errors during its execution

11. Which of the following functions should not use a return statement?

Ans : void

12. What will be the output of the following C program?

 

#include<stdio.h>

int main()

 {

     int arr[1]={10};

     printf("%d", arr[0]);

     return 0;

 }

Ans : 10

13. What will be the output of the following program?

#include<stdio.h>

 int main()

 {

     int i = 5;

     while(i-- >= 0)

         printf("%d,", i);

     i = 5;

     printf("\n");

     while(i-- >= 0)

         printf("%i,", i);

     while(i-- >= 0)

         printf("%d,", i);

     return 0;

 }

Ans : 4, 3, 2, 1, 0, -1

          4, 3, 2, 1, 0, -1

14. What will be the output of the following program?

#include<stdio.h>

 int check(int);

 int main()

 {

     int i=45, c;

     c = check(i);

     printf("%d", c);

     return 0;

 }

 int check(int ch)

 {

     if(ch >= 45)

         return 100;

     else

         return 10;

 }

Ans : 100

15. What does a logical operator return for a true condition?

Ans : 1

16. Point out the error line in the following program.

      1. #include<stdio.h>

      2. int main()

      3. {

      4.     void v = 0;

      5.     printf("%d", v);

      6.     return 0;

      7. }

Ans : Line number 4

17. Point out the error line in the following program.

      1. #include<stdio.h>

      2. #include<string.h>

      3.  int main()

      4.  {

      5.      static char str1[] = "Welcome";

      6.      static char str2[20];

      7.      static char str3[] = "Sir";

      8.      str2 = strcpy(str3, str1);

      9.      printf("%s\n", str2);

    10.      return 0;

    11. }

Ans : Line number 8

18. What will be the output of the program? Type the answer with the correct case.

#include<stdio.h>

 int main()

 {

   char str[6] = "India ";

   printf("%s",str); 

   return 0;

 }

Ans : India

19. Which of the following format specifiers is used to provide exactly 4 digits after decimal point?

Ans : %.4f

20. What will be the output of the following program?

#include<stdio.h>

int main()

 {

     int fun(int);

     int i = fun(10);

     printf("%d\n", --i);

     return 0;

 }

 int fun(int i)

 {

 return (i++);

}

Ans : 9

21.  What is the purpose of namespace?

Ans : To avoid name collisions

22. What will be the output of the following program?

#include<stdio.h>

 int main()

 {

     int a = 500, b = 100, c;

     if(!a >= 400)

         b = 300;

     c = 200;

     printf("b = %d c = %d", b, c);

     return 0;

 }

Ans : b = 100 c = 200

23. What will be the output of the following C program?

#include<stdio.h>

 int sumdig(int);

 int main()

 {

     int a, b;

     a = sumdig(123);

     b = sumdig(123);

     printf("%d, %d", a, b);

     return 0;

 }

 int sumdig(int n)

 {

     int s, d;

     if(n!=0)

     {

         d = n%10;

         n = n/10;

         s = d+sumdig(n);

     }

     else

         return 0;

     return s;

 }

Ans : 6, 6

24. Which of the following cannot be checked in a switch-case statement?

Ans : Float

25. Which of the following operators will give the remainder after dividing 3 by 2?

Ans : %

26. Point out the error line in the following program.

     1.    #include<stdio.h>

     2.     int main()

     3.     {

     4.         int i = 1;

     5.         switch(i)

     6.         {

     7.             printf("This is c program.");

     8.             case 1:

     9.                 printf("Case1");

    10.                 break;

    11.             case 2

    12.                 printf("Case2");

    13.                 break;

    14.         }

    15.     return 0;

    16.     }

Ans : Line number 11

27. Select the missing code lines from the dropdown provided.

The C code given below should print the sum of digits of a number entered by the user.

But, line numbers 6 and 10 are missing.

     1. #include<stdio.h>

     2. int main()

     3. {

     4.     int num, sum=0, rem;

     5.     printf("Enter a number\n");

     6.     ---------------Missing code -------------------

     7.     while(num>0)

     8.     {

     9.         rem = num%10;

   10.   ---------------Missing code -------------------      

   11.         num = num/10;

   12.     }

   13.     printf("Sum is %d\n", sum);

   14.     return 0;

   15. }

Ans :-

Line 6 : scanf("%d", &num);

Line 10 : sum = sum+rem;

28. If originally x=10, what is the value of the expression:

--x;

Ans : 9

29. What will be the output of the following program?

 

#include<stdio.h>

 int main()

 {

     int a = 300, b, c;

     if(a >= 400)

         b = 300;

     c = 200;

     printf("%d,%d", a, c);

     return 0;

 }

Ans : 300,200

30. What will be the output of the following C program?

 

#include<stdio.h>

 int main()

{

    char t;

    char *p1 = "Spoken", *p2;

    p2=p1;

    p1 = "Tutorial";

    printf("%s %s", p1, p2);

    return 0;

}

Ans : Tutorial Spoken

31. What will be the output of the following program?

 

#include<stdio.h>

 int main()

 {

     int a = 7;

     if(a%6)

         printf("Hi");

     else

         printf("Hello");

     return 0;

 }

Ans : Hi

32. If x=10 and sum=0, what is the value of sum after we execute sum=++x?

Ans : 11

33. What will be the output of the following program?

#include<stdio.h>

 int fun(int(*)());

  int main()

 {

     fun(main);

     printf("Hi");

     return 0;

 }

 int fun(int (*p)())

 {

     printf("Hello ");

     return 0;

 }

Ans : Hello Hi

34. What will be the output of the following C program?

#include<stdio.h>

 void fun(int*, int*);

 int main()

 {

     int i=5, j=2;

     fun(&i, &j);

     printf("%d, %d", i, j);

     return 0;

 }

 void fun(int *i, int *j)

 {

     *i = *i**i;

     *j = *j**j;

 }

Ans : 25, 4

35. Which of the following is the correct way of writing a comment in C?

Ans : /* Comment */

36. What is the variable called that is declared outside all the functions?

Ans : Global variable

37. What is the range of a character variable?

Ans : -128 to 127

38. What is the format specifier for double data-type?

Ans : %lf

39. What will be the output of the following C program?

#include<stdio.h>

int main()

{

     int a[5] = {5, 3, 15, 20, 25};

     int i, j, m;

     i = ++a[1];

     j = a[1]++;

     m = a[i++];

     printf("%d, %d, %d", i, j, m);

     return 0;

}

Ans : 5, 4, 25

40. Which of the following keywords is used to create a string?

Ans : char

41. How many cases a switch statement can have?

Ans : Any number

42. What will be the output of the following C program?

#include<stdio.h>

 int sumdig(int);

 int main()

 {

     int a, b;

     a = sumdig(123);

     b = sumdig(123);

     printf("%d, %d", a, b);

     return 0;

 }

 int sumdig(int n)

 {

     int s, d;

     if(n!=0)

     {

         d = n%10;

         n = n/10;

         s = d+sumdig(n);

     }

     else

         return 0;

     return s;

 }

Ans : 6, 6

43. What will be output on execution of the following C code?

#include<stdio.h>

int main()

{

    int a=11;

    printf("%d",a);

    return 0;

}

Ans : 11

44. What will be output of the following c program?

#include<stdio.h>

int xyz=10;

int main(){

    int xyz=20;

    printf("%d",xyz);

    return 0;

}

Ans : c. 20

45. What will be the output of the program?  Write the answer in digits not alphabets.

#include<stdio.h>

int main()

{

 int a=2,b=6,c;

 c = a%b;

 printf("%d",c);

 return 0;

}

Ans : 2

46. What will be the output of the program? Type the answer with the correct case.

#include<stdio.h>

int main()

{

 printf("nn/n/nnn/n");

 return 0;

}

Ans : nn/n/nnn/n


C-TEST | BY :- NISHANT KUMAR

 

ARDUINO - TEST (Spoken Tutorial) ANSWER