Monday, 2 July 2012

C Programming Strings Questions with Explanation

0 comments

String questions in c interview


Answer and explanation of questions are based on turbo c 3.0 compilers. Answer and explanation may vary in other compilers.
1.
What will be output when you will execute following c code?

#include<stdio.h>
void main(){
    char arr[7]="Network";
    printf("%s",arr);
}
Choose all that apply:
(A)Network
(B)N
(C)Garbage value
(D)Compilation error
(E)None of the above

newer post

Frequently Asked C Programming Questions in Interviews

0 comments
newer post

C Programming Trick Questions

0 comments

(1) What will be output if you will compile and execute the following c code?

struct marks{
  int p:3;
  int c:3;
  int m:2;
};
void main(){
  struct marks s={2,-6,5};
  printf("%d %d %d",s.p,s.c,s.m);
}

(a) 2 -6 5
(b) 2 -6 1
(c) 2 2 1
(d) Compiler error
(e) None of these

Answer: (c)
Explanation:
Binary value of 2: 00000010 (Select three two bit)
Binary value of 6: 00000110
Binary value of -6: 11111001+1=11111010
(Select last three bit)
Binary value of 5: 00000101 (Select last two bit)
newer post

Write a c program to create dos command directory

0 comments

Write a c program to create dos command: dir.

Answer:

Step 1: Write following code.

#include “stdio.h”
#include “dos.h”
void main(int count,char *argv[]){
   struct find_t q ;
   int a;
   if(count==1)
      argv[1]="*.*";
      a = _dos_findfirst(argv[1],1,&q);
      if(a==0){
         while (!a){
            printf(" %s\n", q.name);
            a = _dos_findnext(&q);
         }
      }
      else{
         printf("File not found");
      }
}

newer post

Sunday, 1 July 2012

3-1 cse/it textbooks download for jntuk, jntuh

0 comments

1) Principles Of Programming Languages
Concepts of Programming Languages Robert .W. Sebesta
Programming languages –Watt


2) Operation Research

3) Software Engineering
Software Engineering,A practitioner’s Approach- Roger S. Pressman


4) Compiler Design
newer post
newer post older post Home