C free online test



TEST YOUR C SKILLS


C programming language free online testing objective types questions answers with explanation for interview or written test.



15 comments:

  1. syntactical que bt repeated thinkg require

    ReplyDelete
  2. Explanation needed:-

    #include
    #include
    void quiz(int w); main() { int x= 5; clrscr(); quiz(5); } void quiz(int w) { if(w>1) { quiz(w/2); quiz(w/2); } printf("*"); }

    ReplyDelete
    Replies
    1. It Will only a print a star because in if condition you haven't written anything so only print one star on terminal

      Delete
    2. q(5) -> q(2) -> q(1)
      . | -> q(1)
      . | -> q(2) -> q(1)
      . -> q(1)

      This is a recursive algorithm. Seven * are printed. The algorithm stops calling q recursivelly when w=1.

      Delete
  3. pointers,functions and strings are my favorite chapters in c programming and i can really defend these in 100%. i love c programming

    ReplyDelete
  4. Mokka subject.

    ReplyDelete
  5. 7 stars printed because
    ist call
    stack[5] return stmt 1st quiz...............(1)
    2nd call
    stack[5,2] return stmt 1st quiz................(2)
    now w=1 <1 print *
    return to (2) pop top element
    now call by 2nd quiz stack[5,,2] return stmt 2nd quiz;...............(3)
    w=1<1 print *
    return to (3)pop top element
    print * and return to (1)pop top element
    stack [5,,,5] call by 2nd quiz...........................(4)
    stack[5,,,5,2] call by 2nd quiz ........................(5)
    now w=1<1 print *
    return goto 5 print *;stack[5,,,5]pop top element
    return goto 4 print *;stack[5,,,,]pop top element
    now print final print one more * due to the 1st call;stack [];pop top element

    ReplyDelete
  6. can u provide some questions on bit programming

    ReplyDelete
  7. Can you tell the meaning of below code
    while(num)
    {
    //
    }

    ReplyDelete
    Replies
    1. while(num)
      {
      }
      if u give no is 0 then condition is fail while wont exicute....
      if u give non zero no conditio always true it goes to infinite loop

      Delete
  8. identify the errors in the program,correct them and explain the output thereof;
    main ()
    {
    int i;
    printf("enter the number")
    scanf"",&i);
    if(i<=50)
    printf("\n entered number is <50)

    ReplyDelete
  9. identify the errors in the program,correct them and explain the output thereof;
    main ()
    {
    int i;
    printf("enter the number")
    scanf"",&i);
    if(i<=50)
    printf("\n entered number is <50)

    ReplyDelete
    Replies
    1. main()
      {
      int i;
      printf("enter i\n");
      scanf("%d",&i);
      if(i<=50)
      printf("entered no is lessthan 50");
      else
      printf("entered no is not in less than 50");
      }

      Delete
  10. hellop can i please get sme help

    ReplyDelete
  11. #include
    #define MAX 1000

    int main(){
    char binaryNumber[MAX],hexaDecimal[MAX];
    long int i=0;

    printf("Enter any hexadecimal number: ");
    scanf("%s",hexaDecimal);

    printf("\nEquivalent binary value: ");
    while(hexaDecimal[i]){
    switch(hexaDecimal[i]){
    case '0': printf("0000"); break;
    case '1': printf("0001"); break;
    case '2': printf("0010"); break;
    case '3': printf("0011"); break;
    case '4': printf("0100"); break;
    case '5': printf("0101"); break;
    case '6': printf("0110"); break;
    case '7': printf("0111"); break;
    case '8': printf("1000"); break;
    case '9': printf("1001"); break;
    case 'A': printf("1010"); break;
    case 'B': printf("1011"); break;
    case 'C': printf("1100"); break;
    case 'D': printf("1101"); break;
    case 'E': printf("1110"); break;
    case 'F': printf("1111"); break;
    case 'a': printf("1010"); break;
    case 'b': printf("1011"); break;
    case 'c': printf("1100"); break;
    case 'd': printf("1101"); break;
    case 'e': printf("1110"); break;
    case 'f': printf("1111"); break;
    default: printf("\nInvalid hexadecimal digit %c ",hexaDecimal[i]); return 0;
    }
    i++;
    }

    return 0;
    }
    why use char to store the binary value

    ReplyDelete