Languages-C & C Plus Plus [3i Infotech Placement]: Sample Questions 206 - 208 of 354

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 206

C & C Plus Plus
Edit

Describe in Detail

Essay▾

Who is an Actor?

Explanation

  • Actor interacts with the system and initiates the process (that is USECASE) .
  • actor specifies a role of user or any other system that interacts with the subject.
  • Primary actor of a use case calls on the system services.
Given the Image is Defining the Actor in USECASE Diagram

Question 207

C & C Plus Plus
Edit

Describe in Detail

Essay▾

What are enumerations?

Explanation

Understanding of Enumerated Data Type
  • Enumerations consist of a set of named integer constants.
  • Assigns names to integral constants, the names make a program easy to read and maintain.
  • Enumeration stores one of the values of the enumeration set defined by that type.
  • Enum can br used in indexing expressions and operands of all arithmetic and relational operators.

Question 208

C & C Plus Plus
Edit

Describe in Detail

Essay▾

What is the output of the following program?

  1. main ()
  2. {
  3.     inty;
  4.     scanf ( “%d” &y); //input given is 2000
  5.     if ( (y%4 == 0 && y%100! =0)|y%100 == 0)
  6.     printf ( “%disaleapyear” );
  7.     else
  8.     printf ( “%disnotaleapyear” );
  9. }

Explanation

  • 2000 is a leap year
  • In a program
Table Shows the Program
int y;Given a integer variable y
scanf ( “% d” &y) ;Input the value of y

Input given is 2000

if ( (y % 4 == 0 && y % 100! = 0) | y % 100 == 0)

printf ( “% d is a leap year” ) ;

else

printf ( “% d is not a leap year” ) ;

Condition to check if leap year or not.
  • Here print the 2000 is a leap year.

Developed by: