Select chapter



functions (3.papers)
loops (1.papers)
arrays (2.papers)
structures (3.papers)
unions (1.papers)
pointers (7.papers)
null pointers (1.papers)
strings (2.papers)
misc c concepts (1.papers)
Data structures (5.papers)
linked lists (3.papers)
trees (1.papers)
basics (5.papers)
Hide

Sponsored Links


  

c interview questions and answers

Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
4
I want to declare a data structure Employee where I want to store his eno (int), ename(string of 50chars), and one of the values {grade(int), or result(int), or pf(int) }. Then how should I frame this data structure?
  1. struct Emp{
        int eno;
        char ename[50];
        int grade;
        int result;
        int pf;
    }s;
  2. struct one{
            int grade;
            int result;
            int pf;
    };
        
    union Emp{
        int eno;
        char ename[50];
        struct one i;
    }s;
  3. union one{
            int grade;
            int result;
            int pf;
    };
        
    struct Emp{
        int eno;
        char ename[50];
        union one i;
    }s;
  4. struct Emp{
        int eno;
        char ename[50];
        union one{
            int grade;
            int result;
            int pf;
        };
    }s;
Show Answer
Share Facebook gmail Twitter
Read more papers :