Decision statements available in c


Q1. Define the term macro. As well design a macro to determine the smallest number among three given numbers.

Q2. Determine the output of the program shown below?

typedef struct soldier
{
char *name;
char *rank;
int serial_number;
} SOLDIER;
SOLDIER soldier1, soldier2, soldier3, *ptr;
ptr = &soldier3;
soldier3.name = “Anand Mohanti”;
printf(“\n%s”, (*ptr).name);
printf(“\n%c”, *ptr->name);
printf(“\n%c”, *soldier3.name);
printf(“\n%c”, *(ptr-> name + 4));

Q3. Distinguish between call by value and call by reference by giving appropriate illustration.

Q4. ‘C’ is a block structured language. Describe the use of this? Write down an illustration to describe this.

Q5. Illustrate the various kinds of decision statements available in the ‘C’?

Q6. Distinguish between the syntax and execution errors.

Q7. Define a structure to store the given information regarding an employee:

Name, Sex(male, female), Marital_status(single, married, divorced or widowed), age(using bit fields)

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Decision statements available in c
Reference No:- TGS011129

Expected delivery within 24 Hours