What is the output of below code?

1 2 3 4 5 6 7 8 | #include "iostream" using namespace std; int main() { int i; i = 1 + ( 1, 4, 5, 6, 3); cout<<i; } |

a) 4

b) 7

c) compile time error

d) no output

The correct answer for this question is b)7 if we perform the arithmetic operation with in parenthesis the largest number from the set is taken for computation of output

Description :

- C++ programs for the implementation of Breadth First Search(BFS) for a given graph
- C++ programs for the implementation of Depth-first search(DFS) for a given graph
- Palindrome checking using function overloading
- C++ program to implement dynamic programming algorithm to solve the all pairs shortest path problem
- C++ programs to implement the Primâ€™s algorithm to generate a minimum cost spanning tree

Email: |

8951
algorithm
array
ASM program
binary tree
C/C++
C/C++ Programms
c graphics
c interview question
class
cpp
c program
c programs
C Programs
Data structure
download
engineering questions
free
frequently asked interview questions
Graphics
HDL
interview questions and answers
it interview questions
Java
Java program
Keyboard Interface
lab programs
linked list
Linked Lists
Microcontroller
microprocessor
program
programs
questions for an interview
Queue
source code
Source Codes
stack
Stepper motor
templates
top interview questions
verilog
Verilog program
Verilog programs
vlsi

This is the one stop educational site for all Electronic and Computer students. If you want to learn something new then we are here to help. We work on Microcontroller projects, Basic Electronics, Digital electronics, Computer projects and also in basic c/c++ programs.

#Home #Sitemap #Resources #Terms of Use

Copyright©2012 electrofriends.com All Rights Reserved

Contact:info@electrofriends.com

Your answer is wrong dude.Output would be 4…Just try to compile and run the code…..

@Aryan thanks for pointing out the mistake it takes the last number in the parenthesis for evaluation