int main() {
int d = 10;
int m = 2;
int y = 3603;
int c = 0;
int val;
val = ( d + m + y + (y/4) + c) % 7;
cout << val;
return 0;
}



int main() { int d = 10; int m = 2; int y = 3603; int c = 0; int val; ..

Answer / Rakesh Singh

The given C++ code calculates a value using an arithmetic expression and prints it out. The value is calculated as the remainder when the sum of d (day), m (month), y (year), and c (century, set to 0) plus one-fourth of the year is divided by 7. This calculation could be used for a variety of purposes, such as determining the day of the week.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Engineering AllOther Interview Questions

any one can help me to know the top mnc companies and their working platforms?i mean java,php...

1 Answers  


A person was fined for exceeding the speed limit by 10mph.another person was also fined for exceeding the same speed limit by twice the same if the second person was traveling at a speed of 35 mph. find the speed limit?

1 Answers   TCS,


There are prime factors of two numbers a and b , write a program using this prime factors whether a is divisible by b?

1 Answers  


Write the fetch cycle and execute cycle for following instructions:JMPNZ (jump to the given address if the accumulator not equal to zero) RET(return from a subroutine) ADB (add the contents of register B to the accumulator and save result in the accumulator).

1 Answers   IBM,


Can you get the name of the data file used as Infile in the control file used for sql loader, and store it in a column of a table if the name of the data files are in a particular fashion and it is getting picked up one by one for loading the data using the command "Infile *"

0 Answers   Infosys,


what is the main fuction of OSPF in a internetwork? how does work of same network?

1 Answers  


in single linked list , each node contains data and address of next node. if middle of list the node is damaged/crashed then how to find where the link is failed and how to get the all the data which is stored after the crashed node?

1 Answers  


why do you want to join tcs

1 Answers   TCS,


how 2 write a program of this pattern usin for loop?? 1 2 3 4 5 6 7 8 9 10

1 Answers  


How to select the total numbers of fire extinguisher installed in a room ?

1 Answers  


Give an algorithm for the following problem and determine its time complexity. Given a list of n distinct positive integers, partition the list into two sublists, each of size n/2, such that the difference between the sums of the integers in the two sublists is maximized. You may assume that n is a multiple of 2 (i.e. n is even).

1 Answers  


what is test initiation?can anybody post the answer urgently?

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5086)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4453)
  • Electrical Engineering Interview Questions Electrical Engineering (16638)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)