C Questions Answers-C Structure(PartI)


C Structure(PartI)

1. Which of the following statements about the C structure is not true?
a. To use a structure, previously it is defined.
b. A structure can have different types of variables in it.
c. A structure can't have arrays in it.
Check answer 2. In C, we can declare a structure using "structure" keyword.
a. True   b. False Check answer 3. A structure is useful when the program needs to store different values of different types in a single collection.
a. True   b. False Check answer 4. Given a structure definition, a member of the structure can be accessed by one of the following statements:
typedef struct{
  char *emName;
  char *emSex;
  char *emAddress;
  int emSalary;
}Employee;
Employee Emp;
a. Employee.emName;   b. Emp.emName;   c. Emp->emName; Check answer 5. Which of the following statements about accessing the members of structure is not true?
typedef struct{
    char *emp_id;
    char *emp_name;
    char *emp_sex;
}Employee;
Employee Emp, *pEmp;
pEmp=&Emp;
a. Emp->emp_id;
b. pEmp->emp_name;
Check answer 6. Which of the following statements about creating an array (size 20) of structures are not true?
typedef struct{
    char *emp_id;
    char *emp_name;
    char *emp_sex;
}Employee;
a. Employee emp[20];
b. Employee[20] emp;
c. Empoyee[] emp=new Employee[20]; Check answer


Comments

Naeem ul hassan comment

 Naeem ul hassan

someone help me plz..........this code execute only first 10 line and directly compiler go to the end line......so tell me what should I do to execute all the lines........



#include<conio.h>
#include<stdio.h>
int main()
{
int chose;
char op;
printf("select the program \n");
printf("1=>Sketch of hotel's building \n");
printf("2=>Sketch of Office building \n");
scanf("chose");


if(chose==1)
{
printf("Wellcome to the Building of hotel \n");
printf("put the no. of building which you want to visit \n");
scanf("x");
h:
if(chose==1)
printf("Wellcome to the Ground flore of building where you are able to attend your party...\n");
else if(chose==2)
printf("Wellcome to the Second flore of building where you are able to attend Dinner or lunch with your friend...\n");
else if(chose==3)
printf("Wellcome to the Third flore of building where you are able to Reserve any room...\n");
goto h;
getch ();
}
else if(chose==2)
{
printf("Wellcome to your Office");
printf("Put the no. of building where you want visit");
g:
if(chose==1)
printf("Wellcome to the Ground flore of building where you are able to meet your junior...\n");
else if(chose==2)
printf("Wellcome to the second flore of building where you are able to attend your seniors and your rank...\n");
else if(chose==3)
printf("Wellcome to the third flore of building where you are able to attend your Most senior...\n");
else if(chose==4)
printf("Wellcome to the fourth flore of building where you are able to attend your conference...");
goto g;
}
printf("Made by Naeem ul hassan");
getch();
}


2017-06-21



This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.