Buy Questpond's video subscriptions on
huge discount
.
Online: 1283
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Interviews
>
C#
>
Loading ...
Tell the output of the below program
class Program
{
static void main()
{
bool x = true;
if(x = true)
{
if(x = true) break;
System.Console.WriteLine("Hello");
}
System.Console.WriteLine("Hi");
}
}
Posted by
Rajnilari2015
on 3/23/2016 | Category:
C# Interview questions
| Views: 5235 |
Points: 40
Post
|
Interview FAQs
|
Exclusive Questions
|
Interview Home
Select from following answers:
Compile error
Hi
HelloHi
Compiler warning
All Above
Program will compile but with warning because we are using assignment operator instead of equality operator inside the IF statement which is logically wrong. That's the reason it is better to follow Yoda Condition (
http://www.dotnetfunda.com/articles/show/1891/an-introduction-to-yoda-condition-wrt-csharp
)
Show Correct Answer
Asked In:
Many Interviews |
Alert Moderator
Bookmark It
< Previous :
Assume 2 columns named as ProductName and ProductC ...
Next > :
Examine the below query Dim db As TestDBEntitie ...
Comments or Responses
Login to post response
More Interview Questions by Rajnilari2015
Examine the below query Dim db As TestDBEntities = New TestDBEntit ...
What will be the output of the below program? Class Program Share ...
What will be the output of the below program? Class Program S ...
Suppose we have a collection, "Students", with one document ...
Suppose we have a StudentGrade Document in MongoDB. Which of the below ...
Suppose we want to insert a document into the Student collection with ...
Which of the following data types available in BSON?
What will be the output of the below JS code segment x = { "a&qu ...
Latest Interview Questions
Can we make all Ajax calls Cache free?
How to create an object in Angular JS
How to loop elements in Angular Js
We generally have this question in most of the interviews on Garbage c ...
Explain how Angular JS Boot process works?
What is Dependency Injection and how it is useful in MVC?
How can we add a CSS file in Razor View?
What are Scaffold templates in MVC?
More ...