Skip to main content

Spoken Tutorial C test answer

1)  In the following statements, what does 6 specify?

 int num[6];
 num[6]=21;

Select one:
What will be the output of the following program?

#include<stdio.h>
 int main()
 {
     char j=1;
     while(j < 5)
     {
         printf("%d, ", j);
         j = j+1;
     }
     printf("\n");
     return 0;
 }

Select one:
What will be output when you will execute following c code?
 
#include<stdio.h>
void main(){
    int a=5,b=10;
    if(a < b)
         printf("%d  %d",++a,b++);
    else
         printf("John Terry");

}

Select one:
Which of the following special symbols is allowed in a variable name?
Select one:
Which of the following is NOT a logical operator?
Select one:
What is the format specifier for double data-type?
Select one:
7) Which of the following is a derived datatype?
Select one:
What will be output when you execute the following C code?
 
#include<stdio.h>
void main(){
    int a=5,b=10,c=1;
    if(a+b>c+b){
         printf("cquestionbank");
    }
    else{
         break;
    }

}

Select one:
What will be the output of the following C program?

#include <stdio.h>
int main()
{
 char star[10]="HelloWorld";
 printf("%c\n",star[5]);
 return 0;
}

Select one:
Which of the following is used to execute a group of statements repeatedly?
Select one:
What will be the output of the following program?

#include<stdio.h>
 
 int addmult(int ii, int jj)
 {
     int kk, ll;
     kk = ii + jj;
     ll = ii * jj;
     return (kk, ll);
 }
 
 int main()
 {
     int i=3, j=4, k, l;
     k = addmult(i, j);
     l = addmult(i, j);
     printf("%d %d", k, l);
     return 0;
 }

Select one:
What is the purpose of namespace?
Select one:
Which of the following operators will give the remainder after dividing 3 by 2?
Select one:
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;
 }

Select one:
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;
 }

Select one:
Which of the following format specifiers is used to provide exactly 4 digits after decimal point?
Select one:
In the following program, how many times will the for loop execute?

#include<stdio.h>
 int main()
 {
     int i=5;
     for(;scanf("%d", &i); printf("%d", i));
     return 0;
 }

Select one:
What will be the output of the following C program?

#include<stdio.h>
int main()
{
    char str1[] = "Hello";
    char str2[] = "Fellow";
    if(str1[2] == str2[3])
        printf("Equal");
    else
        printf("Unequal");
    return 0;
}

Select one:
What is the output of the following statement?

x=y=z=0;

Select one:
What will be the output of the following program?

#include<stdio.h>
 int main()
 {
     int i=3;
     switch(i)
     {
         case 1:
             printf("Hello");
         case 2:
             printf("Hi");
         case 3:
             continue;
         default:
             printf("Bye");
     }
     return 0;
 }

Select one:
Which of the following statements should NOT be used to increase the value of c by 1?
Select one:
Which function is used to print a message on the terminal or command prompt in C?
Select one:
23) Point out the error line in the following program.

1. #include<stdio.h>
2. int main()
3. {
4.     int i=1,j=1;
5.     if(i=j)
6.     {
7.         printf("i=j");
8.     }
9.     else
10.     {
11.         printf("Not Equal");
12.     }
13. }

Select one:
Point out the error line in the following program.

1.   #include<stdio.h>
2.   int main()
3.   {
4.       int i=1;
5.       for(;;)
6.          {
7.           printf("%d\n", i++);
8.           if(i>10)
9.           break;
10.        }
11.  return 0;
12.  }

Select one:

Comments

Popular posts from this blog

Spoken Tutorial Linux Test answer

 1. we can use command "Alt + T" in the terminal in ubuntu environment? a) True  b) False 2.  Justify whether the commands given below are true or false .  a . $ > chmod -R 744 programming --- > This command is used to assign read , write , execute permission to owner and readonly for all others on programming folder .  b . $ > chown - R www - data : www - data --- > This command is used to change the ownership of all the folders and subfolders including files , under current directory to www - data user . a) True         b) False 3. We can use the commands $ > Is -1 | wc -1 > filecount.txt to check the count of number of files in a directory ? Select one a) True  b) False 4.  The following commands will help us identify the number of lines of code written in programcode.c file . $ > programcode.c | wc - a) True   b) False 5.  Identify whether the output of the following commands is true or false ?   $ > mkdir programs  $ >  cd programs  $ > mv

How to make calculator using HTML in notepad

CODE:-  <html> <head> <script> //function that display value function dis(val) { document.getElementById("result").value+=val } //function that evaluates the digit and return result function solve() { let x = document.getElementById("result").value let y = eval(x) document.getElementById("result").value = y } //function that clear the display function clr() { document.getElementById("result").value = "" } </script> <!-- for styling --> <style> .title{ margin-bottom: 10px; text-align:center; width: 210px; color:green; border: solid black 2px; } input[type="button"] { background-color:green; color: black; border: solid black 2px; width:100% } input[type="text"] { background-color:white; border: solid black 2px; width:100% } </style> </head> &