Hi friends.
I want to know that here how we rewrite the code which is given below?
int a = 6, b = 28, c = 0;
if (a < b) c = a;
Code rewrite
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Dec 27, 2011, 6:56 PM EST
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
int a = 6, b = 28, c = 0;
if (a < b)
{
c = a;
MessageBox.Show(c.ToString());
}
else
{
MessageBox.Show("a Greater than b");
}
}
}
}
Thanks
VulpesRank #55 · 29.2K reputationPosted Dec 27, 2011, 11:40 PM EST
Sam HobbsRank #107 · 20.5K reputationPosted Dec 28, 2011, 5:54 PM EST