tag:blogger.com,1999:blog-90181775532284454232024-03-13T03:02:55.389-07:00Asp.Net Developer CodeWelcome to Dotnet-Way.blogspot.com. We are providing step by step tutorial of ASP.NET Web Forms, ASP.NET MVC, SQL, AngularJS,Interview Que and AnsAnonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.comBlogger42125tag:blogger.com,1999:blog-9018177553228445423.post-1479132850913910112016-01-17T02:57:00.000-08:002016-01-17T03:04:09.316-08:00Create Login form using Angularjs in mvc4<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVAhxKWhlkaR4J8vV6p7Xndj6Mn7aIQgrtjUIk6yAsefUutbWTvUlkcHg_MQQ8dc8h8SpqSiRd0BjEqwVzVWob-F3kkBZbSmgE6vGLTkXpHtC8yj09LgWn7RFGVOiLbvrn8rbeijCxyBxz/s1600/Create+Login+form+using+Angularjs+in+mvc4.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVAhxKWhlkaR4J8vV6p7Xndj6Mn7aIQgrtjUIk6yAsefUutbWTvUlkcHg_MQQ8dc8h8SpqSiRd0BjEqwVzVWob-F3kkBZbSmgE6vGLTkXpHtC8yj09LgWn7RFGVOiLbvrn8rbeijCxyBxz/s400/Create+Login+form+using+Angularjs+in+mvc4.jpeg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2 style="border: 0px; color: #555555; font-family: Ubuntu, sans-serif; font-size: 28px; font-weight: normal; line-height: 55px; margin: 0px; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">
Create Login page using Angularjs in asp.net mvc4.</h2>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
In this post, i would like to create login Page using Angularjs in Asp.net mvc4</div>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">step-1 :-</strong><br />
<b> </b>Create table into database</div>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
open database > Right click on table > add new table > add column name > save > enter table name > ok<br />
here, i have used one table like below..</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-Fdl9ZVLyPpetvrVHhmHD7dvjFmwt7OEM5Fl3mTWFMxbEJpjsRumsuUjkRE2U3Ct7lMegqB7lMzO5qISFF6145Py3tn_E82Pb_XIFeqYJUud_PKMmemauXtdKmn8EGzi8d_pi_4AZX_Jw/s1600/Login+database.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="227" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-Fdl9ZVLyPpetvrVHhmHD7dvjFmwt7OEM5Fl3mTWFMxbEJpjsRumsuUjkRE2U3Ct7lMegqB7lMzO5qISFF6145Py3tn_E82Pb_XIFeqYJUud_PKMmemauXtdKmn8EGzi8d_pi_4AZX_Jw/s640/Login+database.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">step-2:-</strong><br />
Create Entity data model</div>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
Here i have explained about how to create entity data model. <a href="http://dotnet-way.blogspot.in/2015/09/create-entity-data-model-from-databse.html" target="_blank">click here</a></div>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">step-3:-</strong><br />
<b> </b>Add new controller into controller folder</div>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
Right click on controller folder > add > click on controller > now Enter name of controller > select Empty mvc controller > Add</div>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Step-4:-</strong><br />
Now add new action into controller for return data into database</div>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
here i have added action "GetLogin"..please write this following code.....</div>
<pre class="brush:csharp">public ActionResult GetLogin(Registration d)
{
using (LoginEntities _LoginEntities = new LoginEntities())
{
var user = _LoginEntities.Registrations.Where(u => u.Email == d.Email && u.Password == d.Password).FirstOrDefault();
if (user != null)
{
Session["UserId"] = user.RegistrationId.ToString();
Session["Email"] = user.Email.ToString();
Session["UserName"] = user.FName.ToString() + "" + user.LName.ToString();
return new JsonResult { Data = user, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
else
{
return null;
}
}
}</pre>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<br /></div>
<div style="border: 0px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">step-5:-</strong><br />
Install angularjs package. here i have explained about install angularjs package<br />
<br /></div>
<div style="border: 0px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzsg-0Y2WHfstHaWRL2pAL6ZdwamQuHIG5Q1yDp-q4nScYf4PpHCPwW0Zft5rrgW0-cE5k-tVvoBMxQWiF69SXw1eeaeplFWMkjtihl3SzsT3AgNazzAYEf4WOverDHetz5r_OSyOxiBJm/s1600/Install+angularjs+package.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="612" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzsg-0Y2WHfstHaWRL2pAL6ZdwamQuHIG5Q1yDp-q4nScYf4PpHCPwW0Zft5rrgW0-cE5k-tVvoBMxQWiF69SXw1eeaeplFWMkjtihl3SzsT3AgNazzAYEf4WOverDHetz5r_OSyOxiBJm/s640/Install+angularjs+package.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGRTOZzAPWEOsXdMjxOIG3hNs6IoZNLQLJhSu-zPxomTklJVdfvZK8nFo8v4n70F-USdq7wFY_lRjDT6Dur9gbMFiO2kK6-pLTSlhEkrLABVTyk6ijpQJ1WgZ9SLH5j-Ax2vsNifn4cRs6/s1600/Angularjs+package.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="425" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGRTOZzAPWEOsXdMjxOIG3hNs6IoZNLQLJhSu-zPxomTklJVdfvZK8nFo8v4n70F-USdq7wFY_lRjDT6Dur9gbMFiO2kK6-pLTSlhEkrLABVTyk6ijpQJ1WgZ9SLH5j-Ax2vsNifn4cRs6/s640/Angularjs+package.jpg" width="640" /></a></div>
<br />
<br />
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">step-6:-</strong><br />
add a new three javascript file(module.js, controller.js and factory.js) on "AngulrJs" folder under Script folder</div>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
Go to solution explorer > Right click on "Angularjs" folder under Script folder > add > select javascript file > enter name of the file > Add<br />
Now, lets move on write the following code for particluar file....</div>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Module.Js :- </strong></div>
<pre class="brush:csharp">var app = angular.module('myapp', []);
</pre>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="background-color: white; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Controller.js :-</strong></strong></div>
<pre class="brush:csharp">app.controller('LoginController', function ($scope, Loginfactory) {
$scope.Login = '';
$scope.submit = function () {
var responsePromise = Loginfactory.GetUser($scope.login);
responsePromise.then(function (successData) {
if (successData.data.Email != null && successData.data.Password != null)
{
// Here "/Login" is Controller name for redirect to other page after login user...
window.location.href = "/Login"
}
else {
$scope.message = "User or password does not match!";
}
});
}
});</pre>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><strong style="background-color: white; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">factory.js :-</strong></strong></div>
<pre class="brush:csharp">app.factory('Loginfactory', function ($http) {
return {
GetUser: function (_Registration) {
return $http({
url: "/Login/GetLogin",
method: "POST",
data: { d: _Registration }
});
},
};
});
</pre>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><br /></strong>
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">step-7:-</strong><br />
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: white; font-weight: normal;"> Add new action into controller for get view from login</span><br style="background-color: white; font-weight: normal;" /><span style="background-color: white; font-weight: normal;">here i have added "LoginView" action into Logincontroller. please write following code.</span></strong></div>
<pre class="brush:csharp">public ActionResult LoginView()
{
return View();
}
</pre>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><br /></strong>
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">step-8:-</strong><br />
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: white; font-weight: normal;"> Add view for "LoginView" Action</span><br style="background-color: white; font-weight: normal;" /><span style="background-color: white; font-weight: normal;">Right click on Index action method > Add view > Enter view name > Add</span></strong></div>
<pre class="brush:csharp">@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Login</title>
<script src="~/Scripts/angular.min.js"></script>
<script src="~/Scripts/Angular/Module.js"></script>
<script src="~/Scripts/Angular/controller.js"></script>
<script src="~/Scripts/Angular/factory.js"></script>
</head>
<body ng-app="myapp">
<div ng-controller="LoginController">
<form name="loginform">
<div style="color:green">{{message}}</div>
<table>
<tr>
<td>User Name</td>
<td><input type="text" ng-model="login.Email" name="Email" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="text" ng-model="login.Password" name="Password" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Login" ng-click="submit()" /></td>
</tr>
</table>
</form>
</div>
</body>
</html>
</pre>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><br /></strong>
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">step-9:-</strong><br />
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: white; font-weight: normal;"> Add new action into controller for redirect to other page after user login</span><br style="background-color: white; font-weight: normal;" /><span style="background-color: white; font-weight: normal;">here i have added "Index" action into Logincontroller. please write following code.</span></strong></div>
<pre class="brush:csharp">public ActionResult Index()
{
if (Session["Email"] != null)
{
return View();
}
else
{
return RedirectToAction("LoginView");
}
}
</pre>
<div style="border: 0px; color: #1d1d1d; font-family: Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 15px; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><br /></strong>
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">step-9:-</strong><br />
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="background-color: white; font-weight: normal;"> Add a view for "Index" Action</span><br style="background-color: white; font-weight: normal;" /><span style="background-color: white; font-weight: normal;">this view page can display after user login. please write following code.</span></strong></div>
<pre class="brush:csharp">@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<script src="~/Scripts/angular.min.js"></script>
</head>
<body>
<div ng-if="@Session["UserId"] == 0">
Welcome @Session["UserName"].ToString();
</div>
</body>
</html>
</pre>
<div>
Now run this application...........
<br />
<br />
Thnx for watching.....please share with your friends...<br />
any query write comment below...</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com16tag:blogger.com,1999:blog-9018177553228445423.post-4928392951606950762016-01-15T23:22:00.001-08:002016-01-17T03:02:51.739-08:00Cascading Dropdown list Using Angularjs in MVC4<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH8g4RosD8TcCRUw2ijsZEYj3n0y9HgtjwvreNX92JSFVEUihgNsdecOtmKu1lKvHoMmC0j6gyPm1JOTFNcQoelg2-FSt6yOkXPAC9YCY-dnsFcI-UiKEtYNgTANUs1brsSYqTjoA-M12_/s1600/Cascading+Dropdown+list+Using+Angularjs+in+MVC4..jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH8g4RosD8TcCRUw2ijsZEYj3n0y9HgtjwvreNX92JSFVEUihgNsdecOtmKu1lKvHoMmC0j6gyPm1JOTFNcQoelg2-FSt6yOkXPAC9YCY-dnsFcI-UiKEtYNgTANUs1brsSYqTjoA-M12_/s400/Cascading+Dropdown+list+Using+Angularjs+in+MVC4..jpeg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<h2 style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; text-align: left;">
Cascading Dropdown list Using Angularjs in MVC4.</h2>
<div>
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">In this post, I would like to explain How to implement Cascading DropDownList with AngularJS and ASP.NET MVC.</span></div>
<div>
<br style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;" />
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">we need to display DropDownLists in our web page such that values in one DropDownList are dependent on the value selected in another DropDownList.</span></div>
<div>
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"><br /></span></div>
<div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<strong>step-1 :- </strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
Create Database into two table country and state</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br />
open database > Right click on table > add new table > add column name > save > enter table name > ok</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br />
here, i have used two table (country and state) like below..</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi20g0w4qb_17aZiTSJjejbZdnjIK1ofWFMfadbvqgol6vgnUlW0SNi_KFSCxELR9bOBXf6Zd3nbpQUIMVLmPPkdH9ouAJUWUKjLdGTS-Wll7TLMLbRONX9bbyTZRwt3Rs7InJfrGv35dVm/s1600/Country+database+table.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi20g0w4qb_17aZiTSJjejbZdnjIK1ofWFMfadbvqgol6vgnUlW0SNi_KFSCxELR9bOBXf6Zd3nbpQUIMVLmPPkdH9ouAJUWUKjLdGTS-Wll7TLMLbRONX9bbyTZRwt3Rs7InJfrGv35dVm/s400/Country+database+table.jpeg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2Y3t1_f9raoylhoFVMUKpSLtxat6-VXOWsUlV1y69Sp_Irb0tz6uHgpXxfNZno_oXESUagLendObNMgTkcFghFurLiBmX7UxOWag8g_QWhYztbnEUMqqUqCEUG_do7sOCavlo08Jei4qr/s1600/State+database.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="122" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2Y3t1_f9raoylhoFVMUKpSLtxat6-VXOWsUlV1y69Sp_Irb0tz6uHgpXxfNZno_oXESUagLendObNMgTkcFghFurLiBmX7UxOWag8g_QWhYztbnEUMqqUqCEUG_do7sOCavlo08Jei4qr/s400/State+database.jpeg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<strong>step-2:-</strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<strong><br /></strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
Create Entity data model</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
Here i have explained about how to create entity data model. <a href="http://dotnet-way.blogspot.in/2015/09/create-entity-data-model-from-databse.html" target="_blank"> click here</a></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<strong>step-3:-</strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<strong><br /></strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
Add new controller into controller folder</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br />
Right click on controller folder > add > click on controller > now Enter name of controller > select Empty mvc controller > Add</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
follow below image...</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ7poalfoZ9kuJtqCXAB-nNy_UtKch_Wyynk3cefJyVRiPGOrgiRPvM_jskZVMSTK1PuDig2urkfutKWrIrNcFZmVxF-PnmkQ4gEry6abO6YcnzEuubu0HSVfMBq7VwJ7IcOQ2NZ4Zswri/s1600/Add+controller.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ7poalfoZ9kuJtqCXAB-nNy_UtKch_Wyynk3cefJyVRiPGOrgiRPvM_jskZVMSTK1PuDig2urkfutKWrIrNcFZmVxF-PnmkQ4gEry6abO6YcnzEuubu0HSVfMBq7VwJ7IcOQ2NZ4Zswri/s400/Add+controller.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjX4Zv1FNQQnmYcdV7ibLWO-3Gq1g697LdqVykmKYpvKabGPZrVOl71ilQbgTUWdZ4HUPsue76197Cs9kNK7nHekYZQJiq140bTr9Wk6NM9yk8YeWE8j5ZTrn77CJ2ZdFvFo0X90MHE9BjJ/s1600/Add+controller+on+controller+folder.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjX4Zv1FNQQnmYcdV7ibLWO-3Gq1g697LdqVykmKYpvKabGPZrVOl71ilQbgTUWdZ4HUPsue76197Cs9kNK7nHekYZQJiq140bTr9Wk6NM9yk8YeWE8j5ZTrn77CJ2ZdFvFo0X90MHE9BjJ/s400/Add+controller+on+controller+folder.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<strong>Step-4:-</strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<strong><br /></strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
Now add new action into controller for fatch data from database<br />
Here i have added two action "GetCountry" and "GetStateByCountryID" please write this following code.....</div>
</div>
<pre class="brush:csharp">using CascadingDropDownUsingAngularJs.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace CascadingDropDownUsingAngularJs.Controllers
{
public class CascadingDropdownController : Controller
{
DataBaseEntities db = new DataBaseEntities();
public ActionResult Index()
{
return View();
}
public JsonResult GetCountry()
{
List<Country> _GetCountry = new List<Country>();
try
{
_GetCountry = db.Countries.Where(x => x.CountryId != null).ToList();
return new JsonResult { Data = _GetCountry, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
catch (Exception ex)
{
throw ex;
}
}
public JsonResult GetStateByCountryID(int p_CountryId)
{
try
{
List<State> _GetState = db.States.Where(x => x.CountryId == p_CountryId).ToList();
return new JsonResult { Data = _GetState, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
catch (Exception ex)
{
throw ex;
}
}
}
}
</pre>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
<strong>step-5:-</strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
<strong>
</strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
Install angularjs package. here i have explained about install angularjs package<br />
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
You can download AngularJS library files form <a data-mce-href="https://code.angularjs.org/" href="https://code.angularjs.org/" target="_blank">click here.</a><br />
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
Otherwise you can add project solution on visual studio following below step......<br />
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
Go to solution explore> right click on project solution > click on manage nuget package > search text online "angularjs" > click to install<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvf4k_ZCPtXHLtMGPo0GqCOgJRNUDKiIRWAgR4mIs0Vs_nirHXuYjGJco1a3xNKukq8HwOjD3yEmvrEZdgLKKlKgBw6napUl94KyYbrxWLkLUn9RRfcE1aOwhUyIERSksA7Xj5SMjgn5AV/s1600/Install+angularjs+package.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="383" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvf4k_ZCPtXHLtMGPo0GqCOgJRNUDKiIRWAgR4mIs0Vs_nirHXuYjGJco1a3xNKukq8HwOjD3yEmvrEZdgLKKlKgBw6napUl94KyYbrxWLkLUn9RRfcE1aOwhUyIERSksA7Xj5SMjgn5AV/s400/Install+angularjs+package.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8p1fxZJCaOHBGz59o0SCkzDhu-Do3nyV9uZgcvip0IeJjTY9KOXN251yAaYCi16ryDFA_hT7yKtUKxP-6PdpLTbFWJbFsARnudMGr1jqvjF4irkEubV6FgF8SyPWivLqG9ujq0trRRlTu/s1600/Angularjs+package.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8p1fxZJCaOHBGz59o0SCkzDhu-Do3nyV9uZgcvip0IeJjTY9KOXN251yAaYCi16ryDFA_hT7yKtUKxP-6PdpLTbFWJbFsARnudMGr1jqvjF4irkEubV6FgF8SyPWivLqG9ujq0trRRlTu/s400/Angularjs+package.jpg" width="400" /></a></div>
<br />
<div style="line-height: 21.8182px;">
<strong>step-6:-</strong></div>
<div style="line-height: 21.8182px;">
add a new three javascript file(module.js, controller.js and factory.js) on "AngulrJs" folder under Script folder</div>
<div style="line-height: 21.8182px;">
<br />
Go to solution explorer > Right click on "Angularjs" folder under Script folder > add > select javascript file > enter name of the file > Add</div>
<div style="line-height: 21.8182px;">
<br />
Now, lets move on write the following code for particluar file....</div>
<div style="line-height: 21.8182px;">
<br /></div>
<div style="line-height: 21.8182px;">
<strong style="background-color: white; line-height: 21.8182px;">Module.Js :- </strong><br />
<pre class="brush:csharp">var ModuleApp = angular.module('myapp',[]);
</pre>
<strong style="background-color: white; line-height: 21.8182px;"><br /></strong>
<strong style="background-color: white; line-height: 21.8182px;">Controller.Js :-</strong></div>
<div style="line-height: 21.8182px;">
<strong style="background-color: white; line-height: 21.8182px;"><br /></strong></div>
</div>
<pre class="brush:csharp">ModuleApp.controller('DropDownController', ['$scope', 'Dropdownfactory', function ($scope, Dropdownfactory) {
//get list of country
var response = Dropdownfactory.GetCountry();
response.success(function (successdata) {
$scope.Country = successdata;
})
//get list of state by countryId
$scope.GetState = function (CountryID) {
var response = Dropdownfactory.GetState(CountryID);
response.success(function (successdata) {
$scope.States = successdata;
})
}
}]);</pre>
<div style="line-height: 21.8182px;">
<strong style="background-color: white; line-height: 21.8182px;"><br />Factory.Js :-</strong></div>
<pre class="brush:csharp">ModuleApp.factory('Dropdownfactory', function ($http) {
return {
GetCountry: function () {
return $http({
url: "/CascadingDropdown/GetCountry",
method: "GET",
});
},
GetState: function (countruId) {
return $http({
url: "/CascadingDropdown/GetStateByCountryID",
method: "POST",
data: { p_CountryId: countruId }
});
}
}
});
</pre>
<div style="line-height: 21.8182px;">
<strong style="background-color: white; line-height: 21.8182px;"><br />Step-7:-</strong><br />
<strong style="background-color: white; line-height: 21.8182px;"><br /></strong>
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">Add a view for "Index" Action method</span><br />
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">Right click on Index action method > Add view > Enter view name > Add</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiABzsz19H7Un7FW0_cRU7VUW5YQKhtzi6tS0YE5ZY45wUReydiPXjtprOchiolWaW6nQrlhd_3VevBPghU7zfQvcxPFsNbEZJxto5cNeq_xnUrLU_QUCkhwuSeu_kkUwvDFihN037nz_bG/s1600/Add+view.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="185" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiABzsz19H7Un7FW0_cRU7VUW5YQKhtzi6tS0YE5ZY45wUReydiPXjtprOchiolWaW6nQrlhd_3VevBPghU7zfQvcxPFsNbEZJxto5cNeq_xnUrLU_QUCkhwuSeu_kkUwvDFihN037nz_bG/s400/Add+view.jpg" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBKzdB5vGKywZJjC0smAQN7ZaPW2n3ueRsjqGARuyq1b6ZSLKovwAeR_YJO8atf0c9gLkaB_RNaJnwiJ4pADRaAjYBqDI-eTsdp-aCb3hsyGkMp66_kqz5cUF_Z-vQN2uauoVNOrk2Yx_4/s1600/Add+view+for+action+method.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="393" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBKzdB5vGKywZJjC0smAQN7ZaPW2n3ueRsjqGARuyq1b6ZSLKovwAeR_YJO8atf0c9gLkaB_RNaJnwiJ4pADRaAjYBqDI-eTsdp-aCb3hsyGkMp66_kqz5cUF_Z-vQN2uauoVNOrk2Yx_4/s400/Add+view+for+action+method.jpg" width="400" /></a></div>
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"><br /></span>
<strong style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">Write following code...</strong><br />
<strong style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"><br /></strong></div>
<pre class="brush:csharp">@{
ViewBag.Title = "Index";
}
<body ng-app="myapp">
<div ng-controller="DropDownController">
<h2>Cascading DropdownList using angularjs with asp.net mvc</h2>
Country :
<select ng-model="CountryID" ng-options="country.CountryId as country.CountryName for country in Country" ng-change="GetState(CountryID)">
<option value="">Select Country</option>
</select>
State:
<select ng-model="StateID" ng-options="State.StateId as State.StateName for State in States">
<option value="">Select Country</option>
</select>
</div>
</body>
@section scripts{
<script src="~/Scripts/angular.min.js"></script>
<script src="~/Scripts/AngularJs/Module.js"></script>
<script src="~/Scripts/AngularJs/Controller.js"></script>
<script src="~/Scripts/AngularJs/factory.js"></script>
}
</pre>
<div style="line-height: 21.8182px;">
<strong style="background-color: white; line-height: 21.8182px;"><br />ng-change="GetState(CountryID)":-</strong><br />
<strong style="background-color: white; line-height: 21.8182px;"><br /></strong>
<br />
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
to call GetStates method on selection change of Country dropdown.</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
Now run this application...</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<span style="background-color: white; line-height: 21.8182px;">Thnx for watching.....please share with your friends...</span><br />
<span style="background-color: white; line-height: 21.8182px;">any query write comment below...</span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com3tag:blogger.com,1999:blog-9018177553228445423.post-21203061976545065322016-01-15T22:27:00.000-08:002016-01-17T03:03:05.376-08:00First angularjs Application with MVC Basic Example.<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEin6sR2TkyZ7SAN_oDk6b4TftZh0N84J6dXcEBmqjBBmMUcJHn174rmXkpTYimGh14BUPfqqR8Vk7bv4PFD6LvMzX2P9mVTtzVM0GzoyyrB0eH4GweMmmVHxUiP6qUpDqrFHRGOhHOrNLeb/s1600/First+angularjs+Application+with+MVC+Basic+Example..jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="85" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEin6sR2TkyZ7SAN_oDk6b4TftZh0N84J6dXcEBmqjBBmMUcJHn174rmXkpTYimGh14BUPfqqR8Vk7bv4PFD6LvMzX2P9mVTtzVM0GzoyyrB0eH4GweMmmVHxUiP6qUpDqrFHRGOhHOrNLeb/s320/First+angularjs+Application+with+MVC+Basic+Example..jpeg" width="320" /></a></div>
<h2 class="post-title entry-title" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; text-align: left;">
How to setup frist AngularJS application in MVC4.</h2>
<div>
<br /></div>
<div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
AngularJS is a JavaScript framework (library) based on a very popular software architecture called the MVC or Model-View-Control. Developed by Google engineers in the year 2009, the framework slowly gained popularity and today it is one of most widely used JavaScript frameworks.</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
Angular JS is a JavaScript framework to create Single Page Application. It is a client side MVC framework. Angular JS extends HTML by providing Directives that add functionality to your markup and that allow you to create powerful dynamic templates for application.</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
AngularJs framework provides in-build directives (or attributes) to extend the HTML inside a web page. When we attach these directives to the HTML elements and attributes, it creates a dynamic web page with very little coding.</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
we first need to add the JavaScript file inside the <head> tag of our application.</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
You can download AngularJS library files form <a data-mce-href="https://code.angularjs.org/" href="https://code.angularjs.org/" target="_blank">click here.</a></div>
<pre class="brush:csharp"><head>
<script src="~/Scripts/angular.min.js"></script>
</head>
</pre>
</div>
<br />
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
Now, I have add directive for Html page.</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<strong>“ng-app”:-</strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<strong><br /></strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
The ng-app directive tells Angular which part is associated with an Angular application.<br />
Usually, we define ng-app inside a root element in an HTML file, that is, <html> or the <body> tag. If I define this directive inside the <html> or <body> tag, then the entire page is an Angular application.</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
Below you can see First of all I have used ng-app that will denoted that It is an angular app and you have to provide the name of app which is already defined in “MyApp”.</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<pre class="brush:csharp"><div ng-app="myapp"></div></pre>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
<strong><br /></strong>
<strong>“ng-controller”:-</strong><br />
<strong><br /></strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
<strong>
</strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
The ng-controller directive allows us to bind a unique controller to a view.
I have attached to Div element,tells Angular that "HelloController" will receive the values from a model object and return it to the view.<br />
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
</div>
<pre class="brush:csharp"><div ng-app="myapp">
<div ng-controller="Homecontroller">
// write your following code on part of angular
</div>
</div>
</pre>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
Now times to setup Angular JS Module, Service and Controller.So, create a folder with name “Angular” inside the Content folder for clean code.<br />
<br /></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
after that add Three javascript file inside "Angular" folder create.<br />
1.module.js<br />
2.Service.js<br />
<span style="line-height: 21.8182px;">3.controller.js</span><br />
<span style="line-height: 21.8182px;"><br /></span>
<br />
<div style="line-height: 21.8182px;">
<strong>1. module.js :- </strong></div>
<div style="line-height: 21.8182px;">
<strong><br /></strong></div>
<div style="line-height: 21.8182px;">
we will first initialize and register our application by creating a new Angular Module.</div>
<div style="line-height: 21.8182px;">
<br /></div>
</div>
<pre class="brush:csharp">var ModuleApp = angular.module('myapp',[]);
</pre>
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">A module is a collection of services, directives, controllers, filters, and configuration information.</span>
<br />
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;"><br /></span>
<br />
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<strong>2. Service.js :-</strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<strong><br /></strong></div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
This javascript file "factory.js" for fatching data from database and provide it to controller.</div>
<div style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<br /></div>
<pre class="brush:csharp">ModuleApp.factory('Homefactory', function ($http) {
return {
//write your code for service
}
});
</pre>
<strong style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">3.controller.js</strong> :-<br />
<br />
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">controller.js file use to show data on view</span><br />
<pre class="brush:csharp">
ModuleApp.controller('HomeController', ['$scope','Homefactory' function ($scope,Homefactory) {
//write your code for controller
$scope.message="angularjs frist application"
}]);
</pre>
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">Here, Now time to show data on view for html page.</span><br />
<br />
<pre class="brush:csharp"><html>
<head>
<script src="~/Scripts/angular.min.js"></script>
<script src="~/Scripts/Angular/module.js"></script>
<script src="~/Scripts/Angular/controller.js"></script>
<script src="~/Scripts/Angular/factory.js"></script>
</head>
<body>
<div ng-app="myapp">
<div ng-controller="Homecontroller">
{{message}}
</div>
</div>
</body>
</html>
</pre>
<div style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; white-space: normal;">
<span style="line-height: 21.8182px;">Output give like below....</span></div>
angularjs frist application
<br />
<br />
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">Thnx for watching.....please share with your friends...</span><br />
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">any query write comment below...</span><br />
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"><br /></span></div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com3tag:blogger.com,1999:blog-9018177553228445423.post-91953144994978366782016-01-11T20:32:00.000-08:002016-01-11T20:32:52.006-08:00What is SEO?<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpEAifOPJJMonafM819UwalWfDzVPdYb-SO0ZeAsEgm_sRq9BHEe9wPXsJCfSZeLbfuCN-dNC8sgw69Ff1NQMpEgTNHMeytiSMf3KMx1Vi1F8Poh-8tEBSdXbi7g_dFH2H0UmxFgVfRpEz/s1600/SEO.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpEAifOPJJMonafM819UwalWfDzVPdYb-SO0ZeAsEgm_sRq9BHEe9wPXsJCfSZeLbfuCN-dNC8sgw69Ff1NQMpEgTNHMeytiSMf3KMx1Vi1F8Poh-8tEBSdXbi7g_dFH2H0UmxFgVfRpEz/s1600/SEO.jpg" /></a></div>
<h2 style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">
<strong>What is search optimization?</strong></h2>
<ul data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; text-align: justify;">
<li> SEO stands for<strong> search engine optimization</strong></li>
<li>Search engine optimization (SEO) is "the practice of increasing the quantity and quality of the traffic that you earn through the organic results in search engines".</li>
<li><strong>search engine optimization</strong> is the simple activity of ensuring a website can be found in search engines for words and phrases relevant to what the site is offering. In many respects it's simply quality control for websites. Having said that, if there was ever an industry that was little understood by outsiders it's SEO.</li>
</ul>
<h3 data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; text-align: justify;">
<strong>SEO is a technique for :</strong></h3>
<ul data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; text-align: justify;">
<li>designing and developing a website to rank well in search engine results.</li>
<li>improving the volume and quality of traffic to a website from search engines.</li>
<li>marketing by understanding how search algorithms work, and what human visitors might search.</li>
</ul>
<h3 data-mce-style="text-align: justify;" style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; text-align: justify;">
<strong>How search engine work ?</strong></h3>
<ol style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<li><b>Crawling :- </b><b></b><b></b>Process of fetching all the web pages linked to a website. This task is performed by a software, called a crawler or a spider (or Googlebot, in case of Google).</li>
<li><b>Indexing:- </b>Process of creating index for all the fetched web pages and keeping them into a giant database from where it can later be retrieved. Essentially, the process of indexing is identifying the words and expressions that best describe the page and assigning the page to particular keywords.</li>
<li><strong>Processing:-</strong>Once a document has been crawled, it is saved into a temporary database to be later processed by the <em>indexer</em>. Depending on the search engine, indexing involves applying multiple algorithms to determine the topic of the page, its quality, and how useful a user is likely to find it.</li>
<li><b>Calculating Relevancy:-</b> It is likely that more than one page contains the search string, so the search engine starts calculating the relevancy of each of the pages in its index to the search string.</li>
</ol>
<h3 style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">
<strong><span id="goog_1304303768"></span><span id="goog_1304303769"></span><br /></strong></h3>
<h3 style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">
<strong>What is SEO Copywriting ?</strong></h3>
<ul style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<li>SEO Copywriting is the technique of writing viewable text on a web page in such a way that it reads well for the surfer, and also targets specific search terms.</li>
<li>Its purpose is to rank highly in the search engines for the targeted search terms.</li>
<li>Along with viewable text, SEO copywriting usually optimizes other on-page elements for the targeted search terms.</li>
<li>These include the Title, Description, Keywords tags, headings, and alternative text.</li>
<li> The idea behind SEO copywriting is that search engines want genuine content pages and not additional pages often called "doorway pages" that are created for the sole purpose of achieving high rankings.</li>
</ul>
<h3 style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">
<strong>What is Search Engine Rank?</strong></h3>
<ul style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<li>When you search any keyword using a search engine, it displays thousands of results found in its database. A page ranking is measured by the position of web pages displayed in the search engine results.</li>
<li>If a search engine is putting your web page on the first position, then your web page rank will be number 1 and it will be assumed as the page with the highest rank.</li>
<li>SEO is the process of designing and developing a website to attain a high rank in search engine results.</li>
</ul>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com5tag:blogger.com,1999:blog-9018177553228445423.post-9940474535748395762016-01-11T20:22:00.001-08:002016-01-11T20:24:58.015-08:00Yoast Seo plugin install wordpress beginner guide.<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">
Install a Plugin using WordPress Admin Panel Search Option :-</h2>
<div>
<ul style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">
<li><span data-mce-style="color: #808080;" style="color: grey;">This is by far the easiest way of installing a WordPress plugin. The only downside of this option is that a plugin must be in the WordPress plugin directory. Only free plugins that follow GPL and all WordPress guidelines are in this directory.</span></li>
</ul>
<div>
<span data-mce-style="color: #000000;" style="background-color: white; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"><strong>Step-1:-</strong></span><span style="background-color: white; color: grey; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"> </span></div>
</div>
<div>
<span style="background-color: white; color: grey; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"> First go to your WordPress Admin Panel and click on Plugins</span><br />
<span style="background-color: white; color: grey; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZx9S2jrhKndiHK5XfXp6wkG75vdc3t038CP7JLJpGb677Ux0-G2gVed67pSlUpK8YbJqepIjWzzeU8a3v7_uBrJQKiGKvldLB7ceSrbPAID8whU0LvtKFFdzlVpxInE46RGHpHQJe0m-s/s1600/Yoast+seo+plugin+install.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="292" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZx9S2jrhKndiHK5XfXp6wkG75vdc3t038CP7JLJpGb677Ux0-G2gVed67pSlUpK8YbJqepIjWzzeU8a3v7_uBrJQKiGKvldLB7ceSrbPAID8whU0LvtKFFdzlVpxInE46RGHpHQJe0m-s/s640/Yoast+seo+plugin+install.jpg" width="640" /></a></div>
<div>
<strong style="background-color: white; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">step-2:-</strong></div>
<div>
<span style="background-color: white; color: grey; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"> search </span><strong style="background-color: white; color: grey; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">yoast SEO</strong><span style="background-color: white; color: grey; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"> plugin and we will click the install link</span><br />
<span style="background-color: white; color: grey; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLITWZRfj52YaDpjmh6NGDYp33XG47x9F7hK7fXXSVruNLjcCp7Gv1Ef4IZKyZeRjX7ePy1W8c-VBzoZJ39wr2g9vSMqChoZdvO8jONVv8m_k3HVu7sNeFeCXEJTYcLUHokDwCgeTL8Xmv/s1600/Search+yoast+seo+plugin.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLITWZRfj52YaDpjmh6NGDYp33XG47x9F7hK7fXXSVruNLjcCp7Gv1Ef4IZKyZeRjX7ePy1W8c-VBzoZJ39wr2g9vSMqChoZdvO8jONVv8m_k3HVu7sNeFeCXEJTYcLUHokDwCgeTL8Xmv/s640/Search+yoast+seo+plugin.jpg" width="640" /></a></div>
<div>
<strong style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"><br /></strong>
<strong style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;">Step-3:-</strong></div>
<div style="text-align: justify;">
<span style="background-color: white; color: grey; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"> Make sure that you click on Activate the plugin, now you have installed the WordPress plugin. You would have to configure the settings to fit your needs. These settings will vary for each plugin therefore we will not be covering that in this post.now check plugin is activate??</span><br />
<span style="background-color: white; color: grey; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDKs4XRZEJpZ7pqa8vjmh9iNohwlTq7tW0m2vegkDZjBTFOhxLspB4wN4-XmUpeB2Vj_YgLUlqUds0dNod3UTkVlnVhbCwiWkhcgq8UJwj-tX4WkV4HD_GfqfNXdR4niYAdoLBwmqOEPs1/s1600/Active+yoast+seo+plugin.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDKs4XRZEJpZ7pqa8vjmh9iNohwlTq7tW0m2vegkDZjBTFOhxLspB4wN4-XmUpeB2Vj_YgLUlqUds0dNod3UTkVlnVhbCwiWkhcgq8UJwj-tX4WkV4HD_GfqfNXdR4niYAdoLBwmqOEPs1/s640/Active+yoast+seo+plugin.jpg" width="640" /></a></div>
<div style="text-align: justify;">
<span style="background-color: white; color: grey; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; text-align: start;"><br /></span>
<span style="background-color: white; color: grey; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 16px; line-height: 21.8182px; text-align: start;">Thanx for wathching.........</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com20tag:blogger.com,1999:blog-9018177553228445423.post-2565674968685814232015-11-10T02:10:00.002-08:002015-11-14T04:14:21.725-08:00How to use Method Overriding in C# .Net?<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQRTe-OM613qJARwO4zNapyxSvWNiVcHGQXiIumSmHzTUBWsSfTtjVZKgQ4OAz9q6Yriac9qGX6Fl_T3QKDRCBRuT96bx-6m9JgCWbJjqc7jRie_9DupvnjSYBrSXurwk3MEP_6HB3tAy5/s1600/cs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQRTe-OM613qJARwO4zNapyxSvWNiVcHGQXiIumSmHzTUBWsSfTtjVZKgQ4OAz9q6Yriac9qGX6Fl_T3QKDRCBRuT96bx-6m9JgCWbJjqc7jRie_9DupvnjSYBrSXurwk3MEP_6HB3tAy5/s320/cs.png" width="320" /></a></div>
<h2 style="text-align: left;">
How to use Method Overriding in C# .Net?</h2>
<span style="font-size: large;">Creating a method in derived class with same signature as a method in base class is called as method overriding.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Same signature means methods must have same name, same number of arguments and same type of arguments.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Method overriding is possible only in derived classes, but not within the same class.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">When derived class needs a method with same signature as in base class, but wants to execute different code than provided by base class then method overriding will be used.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"><b>Example</b></span><br />
<span style="font-size: large;"><br /><pre class="brush:csharp">using System;<br /><br /><br />namespace methodoverriding<br /><br />{<br /><br /> class BaseClass<br /><br /> {<br /><br /> public virtual string YourCountry()<br /><br /> {<br /><br /> return "India";<br /><br /> }<br /><br /> }<br /><br /><br /> class DerivedClass : BaseClass<br /><br /> {<br /><br /> public override string YourCountry()<br /><br /> {<br /><br /> return "USA";<br /><br /> }<br /><br /> }<br /><br /><br /> class Program<br /><br /> {<br /><br /> <br /><br /> static void Main(string[] args)<br /><br /> {<br /><br /> DerivedClass obj = new DerivedClass();<br /><br /> string Country = YourCountry();<br /><br /> Console.WriteLine(Country);<br /><br /> Console.Read();<br /><br /> }<br /><br /> }<br /><br />}</pre></span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Output</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">USA</span></div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com6tag:blogger.com,1999:blog-9018177553228445423.post-89112459197224610472015-11-10T02:04:00.001-08:002015-12-06T03:54:02.040-08:00How to use Method overloading in c# .Net?<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQRTe-OM613qJARwO4zNapyxSvWNiVcHGQXiIumSmHzTUBWsSfTtjVZKgQ4OAz9q6Yriac9qGX6Fl_T3QKDRCBRuT96bx-6m9JgCWbJjqc7jRie_9DupvnjSYBrSXurwk3MEP_6HB3tAy5/s1600/cs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQRTe-OM613qJARwO4zNapyxSvWNiVcHGQXiIumSmHzTUBWsSfTtjVZKgQ4OAz9q6Yriac9qGX6Fl_T3QKDRCBRuT96bx-6m9JgCWbJjqc7jRie_9DupvnjSYBrSXurwk3MEP_6HB3tAy5/s320/cs.png" width="320" /></a></div>
<br />
<span style="font-size: large;">If a class have multiple methods by same name but different parameters, it is known as Method Overloading. </span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"> string sum(int A)</span><br />
<span style="font-size: large;"> string sum(int A, int B)</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">C# no need to use any keyword while overloading a method either in same class or in derived class. </span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">While overloading methods, a rule to follow is the overloaded methods must differ either in number of arguments they take or the data type of at least one argument.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Example</span><br />
<span style="font-size: large;"></span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><br /></span><div class="brush:csharp" style="text-align: left;">
<span style="font-size: medium;"><pre class="brush:csharp">using System;<br />namespace MethodOverloading<br />{<br /> class Class1<br /> {<br /> public int Sum(int A, int B)<br /> {<br /> return A + B;<br /> }<br /> public float Sum(int A, float B)<br /> {<br /> return A + B;<br /> }<br /> }<br /> class MainClass<br /> {<br /> static void Main()<br /> {<br /> Class1 obj = new Class1();<br /> Console.WriteLine(obj.Sum(20, 30));<br /> Console.WriteLine(obj.Sum(20, 15.70f));<br /> Console.Read();<br /> }<br /> }<br />}</pre>
</span></div>
<span style="font-size: medium;">
</span></div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><br /></span><span style="font-size: medium;">
</span>
<span style="font-size: medium;">
</span></div>
<span style="font-size: large;">Output :-</span><br />
<span style="font-size: large;">50</span><br />
<span style="font-size: large;">35.7</span>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com2tag:blogger.com,1999:blog-9018177553228445423.post-53434482386234428562015-11-10T01:37:00.005-08:002015-12-06T05:42:17.237-08:00How to use array in c# .Net?<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQRTe-OM613qJARwO4zNapyxSvWNiVcHGQXiIumSmHzTUBWsSfTtjVZKgQ4OAz9q6Yriac9qGX6Fl_T3QKDRCBRuT96bx-6m9JgCWbJjqc7jRie_9DupvnjSYBrSXurwk3MEP_6HB3tAy5/s1600/cs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQRTe-OM613qJARwO4zNapyxSvWNiVcHGQXiIumSmHzTUBWsSfTtjVZKgQ4OAz9q6Yriac9qGX6Fl_T3QKDRCBRuT96bx-6m9JgCWbJjqc7jRie_9DupvnjSYBrSXurwk3MEP_6HB3tAy5/s320/cs.png" width="320" /></a></div>
<h2 style="text-align: left;">
<span style="font-size: large;">How to use array in c# .Net?</span></h2>
<span style="font-size: large;">Arrays is a collections of items, for instance strings.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Arrays are declared much like variables, with a set of [] brackets after the datatype, like this:</span><br />
<span style="font-size: large;"> string[] Mobile ;</span><br />
<span style="font-size: large;"><span class="Apple-tab-span" style="white-space: pre;"> </span> string[] Mobile = new string[2];</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">The number (2) is the size of the array, that is, the amount of items we can put in it. Putting items into the array is pretty simple as well:</span><br />
<span style="font-size: large;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>Mobile [0] = "Samsuang";</span><br />
<span style="font-size: large;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Mobile [1] = "sony",</span><br />
<span style="font-size: large;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Mobile [2] = "Nexus"</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Array counting starts from 0 instead of 1. So the first item is indexed as 0, the next as 1 and so on.<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<br />
<span style="font-size: large;">Example</span><br />
<span style="font-size: large;"><br /></span></div>
<pre class="brush:csharp">using System;
using System.Collections;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string[] Mobile = new string[2];
Mobile [0] = "Samsuang";
Mobile [1] = "Sony";
Mobile [2] = "Nexus";
for(int i = 0; i < Mobile .Length; i++)
{
Console.WriteLine("Item number " + i + ": " + Mobile[i]);
Console.ReadLine();
}
}
}
</pre>
<pre class="brush:csharp">}</pre>
<pre class="brush:csharp"></pre>
<pre class="brush:csharp"></pre>
<pre class="brush:csharp"></pre>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-35873691798646393532015-11-10T01:17:00.002-08:002015-12-06T05:43:16.034-08:00how to use Abstract class and Method in c# .Net?<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgOx2KaJRA19JCM7C2PHv3cX0dH9tG-thVWMzn0wI-HkleEco8R6EPDCMzFBArsCB3kVf4nUYgtQdTRLTusXWhR-Vj_a4ff2URKFR77t-Jz_eHLhXSz7Cv0-tQVg8pMbkuOKdOYTz35M2p/s1600/cs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgOx2KaJRA19JCM7C2PHv3cX0dH9tG-thVWMzn0wI-HkleEco8R6EPDCMzFBArsCB3kVf4nUYgtQdTRLTusXWhR-Vj_a4ff2URKFR77t-Jz_eHLhXSz7Cv0-tQVg8pMbkuOKdOYTz35M2p/s320/cs.png" width="320" /></a></div>
<h2 style="text-align: left;">
<span style="font-size: large;">how to use Abstract class and Method in c# .Net?</span></h2>
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">The purpose of abstract class is to provide default functionality to its sub classes.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">When a method is declared as abstract in the base class then every derived class of that class must provide its own definition for that method.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;"> An abstract class can also contain methods with complete implementation, besides abstract methods.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">When a class contains at least one abstract method, then the class must be declared as abstract class. </span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">It is mandatory to override abstract method in the derived class.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">When a class is declared as abstract class, then it is not possible to create an instance for that class. But it can be used as a parameter in a method.</span><br />
<span style="font-size: large;"><br /></span>
<b><span style="font-size: large;">example</span></b><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">The following example creates three classes shape, circle and rectangle where circle and rectangle are inherited from the class shape and overrides the methods Area() and Circumference() that are declared as abstract in Shape class and as Shape class contains abstract methods it is declared as abstract class.</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Code</span><br />
<br />
<pre class="brush:csharp">using System;
namespace ProgramCall
{
//Abstract class
abstract class Shape1
{
protected float R, L, B;
//Abstract methods can have only declarations
public abstract float Area();
public abstract float Circumference();
}
class Rectangle1 : Shape1
{
public void GetLB()
{
Console.Write("Enter Length : ");
L = float.Parse(Console.ReadLine());
Console.Write("Enter Breadth : ");
B = float.Parse(Console.ReadLine());
}
public override float Area()
{
return L * B;
}
public override float Circumference()
{
return 2 * (L + B);
}
}
class Circle1 : Shape1
{
public void GetRadius()
{
Console.Write("Enter Radius : ");
R = float.Parse(Console.ReadLine());
}
public override float Area()
{
return 3.14F * R * R;
}
public override float Circumference()
{
return 2 * 3.14F * R;
}
}
class MainClass
{
public static void Calculate(Shape1 S)
{
Console.WriteLine("Area : {0}", S.Area());
Console.WriteLine("Circumference : {0}", S.Circumference());
}
}
}
</pre>
<span style="font-size: large;">Output</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Enter Length : 10</span><br />
<span style="font-size: large;">Enter Breadth : 12</span><br />
<span style="font-size: large;">Area : 120</span><br />
<span style="font-size: large;">Circumference : 44</span><br />
<span style="font-size: large;"><br /></span>
<span style="font-size: large;">Enter Radius : 5</span><br />
<span style="font-size: large;">Area : 78.5</span><br />
<span style="font-size: large;">Circumference : 31.4</span><br />
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-62574082578052241902015-11-01T08:59:00.000-08:002015-11-11T00:40:02.903-08:00Write a program to print the following pattern using loop in language.<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp7wqS70nybBzt6CCRIc3PxnBFoOK5q52mI4cA6josMSohBIVnoTFde5dyocOoKN3-AyMErx6xoWS6CzlkjX2jMlHI_YxtrGFIWtrFjrQTSUr9kMQRMG50IcYyf9AOt_mSLpgk_PaC1tLP/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp7wqS70nybBzt6CCRIc3PxnBFoOK5q52mI4cA6josMSohBIVnoTFde5dyocOoKN3-AyMErx6xoWS6CzlkjX2jMlHI_YxtrGFIWtrFjrQTSUr9kMQRMG50IcYyf9AOt_mSLpgk_PaC1tLP/s320/5.jpg" width="287" /></a></div>
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<h2>
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Write a program to print the following pattern using loop in language. </span></span></h2>
<br />
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<studio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<coino.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Void main()<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Int
I,j,n,k;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“Enter
Your no : ”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Scanf(“%d”,&n);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(i=1;i<n;i++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">
For(j=1;j<=I;j++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“ “);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(k=n;k>=I;k--)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“*”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“
“);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“\n”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }</span><span style="font-size: 12pt;"><o:p></o:p></span></span></div>
</div>
<br />
<br />
<span style="font-size: large;"><b>output :-</b></span><br />
<br />
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> * * * * * *<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> * *
* * *<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> * * * * <o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> * * *<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> * *<o:p></o:p></span></b></div>
<br />
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> *<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"><br /></span></b></div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-64666484384517092002015-11-01T08:51:00.002-08:002015-11-11T00:39:30.794-08:00Write a program to print the following pattern using loop in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtIUb2V87CIVygIMGX4jujbHTsnS2nmB14jH_1m6-CwnNIshhdHoHpu_HubTiv8GYOgk5eUeheHAOQXa33EACuMiITOIjor0Wp06cTM9mog-C4d1QeO8o-CvYvA1KwSOK1SDyhl_2uDFto/s1600/1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="178" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtIUb2V87CIVygIMGX4jujbHTsnS2nmB14jH_1m6-CwnNIshhdHoHpu_HubTiv8GYOgk5eUeheHAOQXa33EACuMiITOIjor0Wp06cTM9mog-C4d1QeO8o-CvYvA1KwSOK1SDyhl_2uDFto/s320/1.JPG" width="320" /></a></div>
<h2>
Write a program to print the following pattern using loop in c language.</h2>
<br />
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<studio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<coino.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Void main()<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Int
I,j,n,k,l=1,m=65;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“Enter
Your no : ”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Scanf(“%d”,&n);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(i=1;i<n;i++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(j=n;j>I;j--)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“ “);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> If(i%2!=0)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(k=1;k<=I;k++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“%d”,l);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“ ”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> l++;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> else<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(k=1;k<=I;k++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“%c”,m);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“ “);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> m++:<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“\n”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">}</span><span style="font-size: 12pt;"><o:p></o:p></span></span></div>
</div>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b>Output :- </b></span><br />
<br />
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> 1<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> A B<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> 2 3 4<o:p></o:p></span></b></div>
<br />
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> C D E F<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"><br /></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"><br /></span></b></div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-55511058368262239122015-11-01T08:47:00.002-08:002015-11-11T00:39:12.665-08:00Write a program to print the following pattern using loop in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir5nA2PxDlQy7DvnOniEV0omq3nBQqsbZSJwNmVwwql76redHqoS-irDeLx0FrzZiBOG4EuMFBJG4Evc57o-m60Dp_1o_c3BG3gEZIYO54ffYNmRwWKn7cwJ7xtEInybjucAezUOe5PTqy/s1600/20.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir5nA2PxDlQy7DvnOniEV0omq3nBQqsbZSJwNmVwwql76redHqoS-irDeLx0FrzZiBOG4EuMFBJG4Evc57o-m60Dp_1o_c3BG3gEZIYO54ffYNmRwWKn7cwJ7xtEInybjucAezUOe5PTqy/s320/20.JPG" width="320" /></a></div>
<h2 style="text-align: left;">
Write a program to print the following pattern using loop in c language.</h2>
<br />
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<studio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<coino.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Void main()<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Int
I,j,n,k,l=1;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“Enter
Your no : ”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Scanf(“%d”,&n);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(i=1;i<=n;i++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(j=n;j>I;j--)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“ “);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(k=1;k<=I;k++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“%d”,l);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“ “);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> l++;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify; text-indent: .5in;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Printf(“\n”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">}</span><span style="font-size: 12pt;"><o:p></o:p></span></span></div>
</div>
<br />
<br />
<span style="font-size: large;"><b>Output :- </b></span><br />
<br />
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> 1 <o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> 2 3 <o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> 4 5 6<o:p></o:p></span></b></div>
<br />
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> 7 8 9 10<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"><br /></span></b></div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-43774934192304376232015-11-01T08:44:00.000-08:002015-11-03T00:29:33.226-08:00Write a program to print the following pattern using loop in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN-zHmDkhyphenhyphenxc4NWG30YfujfZEqqAFUiYwH2YEt4OHzKAytwfevHFPydZGBRxDqke8qu7OyhRnJG7pz_eJVPLj6ecYD7ofpKzjy1oIc1tfPD9z-OsRqiFOhFNtlTMp1YI3LMGkFN1IFJ58l/s1600/26.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN-zHmDkhyphenhyphenxc4NWG30YfujfZEqqAFUiYwH2YEt4OHzKAytwfevHFPydZGBRxDqke8qu7OyhRnJG7pz_eJVPLj6ecYD7ofpKzjy1oIc1tfPD9z-OsRqiFOhFNtlTMp1YI3LMGkFN1IFJ58l/s320/26.JPG" width="320" /></a></div>
<br />
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<studio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<coino.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Void main()<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Int
I,j,n,k;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“Enter
Your no : ”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Scanf(“%d”,&n);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(i=1;i<=n;i++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> printf(“ “);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(k=1;k<=I;k++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“%d”,i);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“ ”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“\n”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">}<o:p></o:p></span></span></div>
</div>
<br />
<span style="font-size: large;"><b>Output :- </b></span><br />
<br />
<div class="MsoNormal">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> 1<o:p></o:p></span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> 2 2<o:p></o:p></span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> 3 3 3<o:p></o:p></span></b></div>
<br />
<div class="MsoNormal">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> 4 4 4 4<o:p></o:p></span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"><br /></span></b></div>
<div class="MsoNormal">
<b><span style="font-family: "cambria" , "serif"; font-size: 16.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"><br /></span></b></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-52603318361370561902015-11-01T08:40:00.001-08:002015-11-11T00:38:55.596-08:00Write a program to print the following pattern using loop in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJGMf6XO-IJXYJWZmukOHdOenZ2zQQkNN1NyqVoqNqyp6j68KsbDxjur37BYh3hzvHP5_6XtT8UGUEbhNCgcmgfgQAjW0u3PTDPNnS5J71SEIIwUz6ehcOgJ1B_wcL5Wkdo8iChmJ4zRDh/s1600/21.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJGMf6XO-IJXYJWZmukOHdOenZ2zQQkNN1NyqVoqNqyp6j68KsbDxjur37BYh3hzvHP5_6XtT8UGUEbhNCgcmgfgQAjW0u3PTDPNnS5J71SEIIwUz6ehcOgJ1B_wcL5Wkdo8iChmJ4zRDh/s320/21.JPG" width="320" /></a></div>
<h2 style="text-align: left;">
Write a program to print the following pattern using loop in c language.</h2>
<br />
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<stdio.h><o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<conio.h><o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Void main()<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="color: #666666; font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: #666666; font-size: large;"><span style="font-family: "cambria" , serif; line-height: 115%;"> </span><span style="font-family: "cambria" , serif; line-height: 115%;">Int I,j,n,k=1;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Printf(“Enter Your no:”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Scanf(“%d”,&n);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">For(i=1;i<n;i++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(j=1;j<I;j++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(%d”,j);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“
”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> J++;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Printf(“\n”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="color: #666666; font-size: large; line-height: 115%;">}</span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="color: #666666; font-size: large; line-height: 115%;">}</span></div>
</div>
<br />
<span style="font-size: large;"><b>Output :- </b></span><br />
<span style="font-size: large;"><b><br /></b></span>
<br />
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">1<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">2 3<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">3 4 5<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">4 5 6
7<o:p></o:p></span></b></div>
<br />
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">5 6 7
8 9<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;"><br /></span></b></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;"><br /></span></b></div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-90989841732837679792015-11-01T08:36:00.002-08:002015-11-11T00:38:43.130-08:00Write a program to print the following pattern using loop in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRXg5cP6qAGGReMPXjCwqUlbf-R5ybLIcAaXxE8gyaPba6cC_3G4KZyGtSiVRHxRu3f6ybmkvJ5XzVgBiGfc5KbFwlKcaQ6PBfQUg1i-XEDkvx3Gq8ro9dKrVDftwMK1ab69rkoP_HyHJf/s1600/46.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="258" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRXg5cP6qAGGReMPXjCwqUlbf-R5ybLIcAaXxE8gyaPba6cC_3G4KZyGtSiVRHxRu3f6ybmkvJ5XzVgBiGfc5KbFwlKcaQ6PBfQUg1i-XEDkvx3Gq8ro9dKrVDftwMK1ab69rkoP_HyHJf/s320/46.JPG" width="320" /></a></div>
<h2 style="text-align: left;">
Write a program to print the following pattern using loop in c language.</h2>
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<stdio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<conio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Void n main()<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Int n,c,k;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Printf(“Enter Your no:”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Scanf(“%d”,&n);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">For(C=1;C<=n;i++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(K=1;K<=C;K++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“%*”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Printf(“\n”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-left: .5in; text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">}</span><span style="font-size: 12pt;"><o:p></o:p></span></span></div>
</div>
<br />
Output :-<br />
<br />
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">*<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">* * <o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">* *
*<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">* *
* *<o:p></o:p></span></b></div>
<br />
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">* *
* * *<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;"><br /></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;"><br /></span></b></div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-35527917068672170682015-11-01T08:31:00.003-08:002015-11-11T00:38:31.321-08:00Write a program to print the following pattern using loop in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8e5rk56o_ODCU9G2EgXz05hugI_zX5l5P8EoRWw5KjoNkwPD7Oiw2zOwRSslV_zNPuWbRa01Ju9ooevKXJbAkfXGxZgve0VZqxP9C_WDkEyr-On3Ixzrt1ZqriSxDMahMkRnLi8CjB6fB/s1600/56.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="267" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8e5rk56o_ODCU9G2EgXz05hugI_zX5l5P8EoRWw5KjoNkwPD7Oiw2zOwRSslV_zNPuWbRa01Ju9ooevKXJbAkfXGxZgve0VZqxP9C_WDkEyr-On3Ixzrt1ZqriSxDMahMkRnLi8CjB6fB/s320/56.JPG" width="320" /></a></div>
<h2 style="text-align: left;">
Write a program to print the following pattern using loop in c language.</h2>
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<stdio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">#include<conio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">Void main()<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Int I,j,n;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“Enter
Your no:”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Scanf(“%d”,&n);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(i=1;i<=n;i++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> For(j=1;j<I;j++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“%d”,j);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> Printf(“\n”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="line-height: 115%;"><span style="color: #666666; font-size: large;">}</span><span style="font-size: 12pt;"><o:p></o:p></span></span></div>
</div>
<br />
<span style="font-size: large;"><b>Output : -</b></span><br />
<br />
<div class="MsoNormal">
<b><span style="font-size: 12.0pt; line-height: 115%;">1<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">1 2<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">1 2
3<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">1 2
3 4<o:p></o:p></span></b></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;">1 2
3 4 5<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;"><br /></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;"><br /></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span style="font-size: 12.0pt; line-height: 115%;"><br /></span></b></div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-13833402353671409172015-11-01T08:26:00.001-08:002015-11-11T00:38:17.715-08:00write a program to check for prime number in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s1600/c-c%252B%252B.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s320/c-c%252B%252B.jpeg" width="320" /></a></div>
<h2 style="text-align: left;">
write a program to check for prime number in c language.</h2>
<br />
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">#include<stdio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">#include<conio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">Void main( )<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> int
I,n,j,count=0;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> printf(“enter
your number:”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> scanf(“%d”,&n);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> for(i=2;i<n;i++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> If(n%i==0)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Count++; <o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Break;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> If(count==0&&n!=1)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Printf(“entered
no. is prime”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Else<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Printf(“enterd
no. is not prime “);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> }</span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">}<o:p></o:p></span></span></div>
</div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-89829714267699922322015-11-01T08:24:00.000-08:002015-11-11T00:37:22.217-08:00write a program to print fibonacci series using loop in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxOVXNTlJissls4c1-DPn7wgBA04ZN-gopOqQniJTtPpGAitVd65GohyphenhyphennGOCyhwnVTkmYQP7eMn2n44NnSS1031AKAOe0nlXxIYLV4UK1JcyxidiuywSWGviehZny6uOyPQIQtPDmgBJMr/s1600/c-c%252B%252B.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxOVXNTlJissls4c1-DPn7wgBA04ZN-gopOqQniJTtPpGAitVd65GohyphenhyphennGOCyhwnVTkmYQP7eMn2n44NnSS1031AKAOe0nlXxIYLV4UK1JcyxidiuywSWGviehZny6uOyPQIQtPDmgBJMr/s320/c-c%252B%252B.jpeg" width="320" /></a></div>
<h2 style="text-align: left;">
write a program to find factorial of given number in c language.</h2>
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">#include<stdio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">#include<conio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">Void main( )<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Int
n,first=0,second=1,next,c;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Printf(“enter
the number of terms\n”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Scanf(“%d”,&n);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Printf(“first
%d terms of Fibonacci series are :\n”,n);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> For(c=0;c<n;c++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> If(c<=1)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Next=c;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Else<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Next=first+second;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> First=second;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Second=next;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Printf(“%d\n”,next);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> }</span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">}</span><span style="font-size: 12pt;"><o:p></o:p></span></span></div>
</div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-71146613982687809132015-11-01T07:45:00.001-08:002015-11-11T00:37:10.122-08:00write a program to find factorial of given number in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWbFnwNRzSsIz-nUDmiUENHpm21KKetgnEYJHwfEX2QbVkvahEzLZ0VXUNqTcKz0Cow8GPqmIPUQUhzIa13VPmwEmbBrG6vIs1rFafiIV5Nrth0qeoXAkqDijUGRMf6odOBjibQifIkPbc/s1600/c-c%252B%252B.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWbFnwNRzSsIz-nUDmiUENHpm21KKetgnEYJHwfEX2QbVkvahEzLZ0VXUNqTcKz0Cow8GPqmIPUQUhzIa13VPmwEmbBrG6vIs1rFafiIV5Nrth0qeoXAkqDijUGRMf6odOBjibQifIkPbc/s320/c-c%252B%252B.jpeg" width="320" /></a></div>
<h2 style="text-align: left;">
write a program to find factorial of given number in c language.</h2>
<br />
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">#include<stdio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">#include<conio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">Void main( )<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">Int
c,n,fact=1;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">Printf(“enter
a number to calculate it’s factorial\n”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">For(c=1;c<=n;c++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Fact=fact*c;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify; text-indent: .5in;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">Printf(“factorial
of %d=%d\n”,n,fact);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">}</span><span style="font-size: 12pt;"><o:p></o:p></span></span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-52415934952972150432015-11-01T07:43:00.001-08:002015-11-11T00:37:01.740-08:00write a program to find maximum ,minimum ,sum and average of given number in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s1600/c-c%252B%252B.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s320/c-c%252B%252B.jpeg" width="320" /></a></div>
<h2 style="text-align: left;">
write a program to find maximum ,minimum ,sum and average of given number in c language.</h2>
<br />
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">#include<stdio.h><o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">#include<conio.h><o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">Void main( )<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Int
i ,max,min ,sum=0;<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Float
avg;<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Int
num[10];<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Printf(“enter
any 10 numbers :”);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> For(i=0;i<10;i++)<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Scanf(“%d”,&num[i]);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Max=num[0];<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Min=num[0];<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> For(i=1;i<10;i++)<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> If(num[i]>max)<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Max=num[i];<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> If(num[i]<min)<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Min=num[i];<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Sum=sum+num[i];<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Avg=sum/I;<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Printf(“maximum
number is %d “,max);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Printf(“minimum
number is %d “,minimum);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Printf(“sum
of the number %d “,sum);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Printf(“Average
of the number %f “,avg);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">}<o:p></o:p></span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-9562273491790201162015-11-01T07:40:00.001-08:002015-11-11T00:36:48.886-08:00write a program to check for Armstrong number in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s1600/c-c%252B%252B.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s320/c-c%252B%252B.jpeg" width="320" /></a></div>
<h2 style="text-align: left;">
write a program to check for Armstrong number in c language.</h2>
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">#include<stdio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">#include<conio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">Void main( )<o:p></o:p></span></span></div>
<div class="MsoNormal" style="tab-stops: 39.75pt; text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">{ <o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Int
i,j,num,sum=0;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Printf(“enter
any number:”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Scanf(“%d”,&i);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Num=I;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> While(num!=0)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> J=num%10;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Sum=sum+(j*j*j);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Num/=10;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">If(sum==i)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Printf(“entered
no. is Armstrong”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">Else<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Printf(“entered
no. is not Armstrong”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">}</span><span style="font-size: 12pt;"><o:p></o:p></span></span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com1tag:blogger.com,1999:blog-9018177553228445423.post-82134960413915936682015-11-01T07:38:00.000-08:002015-11-11T00:36:22.173-08:00write a program for the series 1+x+x2+x3+……+xn using loop in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s1600/c-c%252B%252B.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s320/c-c%252B%252B.jpeg" width="320" /></a></div>
<br />
<h2 style="text-align: left;">
write a program for the series 1+x+x2+x3+……+xn using loop in c language.</h2>
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">#include<stdio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">#include<conio.h><o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">Void main( )<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Float
series=1;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Int
i,n,x,p=1;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Printf(“enter
the value of n –“);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Scanf(“%d”,&n);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Printf(“\n\n
enter the value of x :”);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Scanf(“%d”,&x);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> For(i=o;i<=n;i++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> For(j=o;j<=I;j++)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> P=p*x;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;"> Series=series+p;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">Printf(“series=%f”,series);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , serif; line-height: 115%;"><span style="font-size: large;">}</span><span style="font-size: 12pt;"><o:p></o:p></span></span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-14507862713527250842015-11-01T07:36:00.001-08:002015-11-11T00:35:22.189-08:00write a program to check the number is odd or even in c language.<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s1600/c-c%252B%252B.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s320/c-c%252B%252B.jpeg" width="320" /></a></div>
<h2 style="text-align: left;">
<span style="font-weight: normal;">write a program to check the number is odd or even in c language.</span></h2>
<br />
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<span style="font-size: large;">#include<stdio.h></span><br />
<span style="font-size: large;">#include<conio.h></span><br />
<span style="font-size: large;">Void main( )</span><br />
<span style="font-size: large;">{</span><br />
<span style="font-size: large;"> Int n;</span><br />
<span style="font-size: large;"> Printf(“enter an integer \n”);</span><br />
<span style="font-size: large;"> Scanf(“%d”,&n);</span><br />
<span style="font-size: large;"> If(n%2==0)</span><br />
<span style="font-size: large;"> {</span><br />
<span style="font-size: large;"> Printf(“even\n);</span><br />
<span style="font-size: large;"> }</span><br />
<span style="font-size: large;"> Else</span><br />
<span style="font-size: large;"> {</span><br />
<span style="font-size: large;"> Printf(“odd\n”);</span><br />
<span style="font-size: large;"> }</span><br />
<span style="font-size: large;">}</span><br />
<div>
<br /></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-71697546549278261362015-11-01T07:27:00.000-08:002015-11-11T00:34:49.812-08:00Find out largest number from give 3 number in C Language .<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: #fbfbfc; border: 1px solid #888; padding: 10px;">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s1600/c-c%252B%252B.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWtw8GMZlQrTadi1mL7xgDgxAdQd9JgAj4efqwjAVbCwDtnDA_eVxHw1iwLVfBLTIQeHUKHqYPUppi5jYI25GkNf2Fwm-nAbrDcFqce2qNPlp9kwbRBMp9D_0zTZJDyXgrRthlEwSuJo6/s320/c-c%252B%252B.jpeg" width="320" /></a></div>
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"><br /></span>
<h2>
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">Find out largest number from give 3 number in C Language . </span></h2>
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">#include<stdio.h><o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">#include<conio.h><o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">Void main()<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Int
a,b,c;<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Printf(“enter
value of a,b,c:”);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Scanf(“%d%d%d”,&a,&b,&c);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> If(a>b)<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> If(a>c)<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Printf(“a
is max”);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Else
<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Printf(“b
is max:”);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Else<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> If(b>c)<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Printf(“b
is max”);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Else <o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> Printf(“c
is max”);<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="color: #666666; font-family: "cambria" , "serif"; font-size: large; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;">}<o:p></o:p></span></div>
<span style="font-size: large;"><span style="color: #666666;"><br /></span>
</span><br />
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: "cambria" , "serif"; font-size: 12.0pt; line-height: 115%; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin;"><span style="color: #666666; font-size: large;">}</span><o:p></o:p></span></div>
</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com0tag:blogger.com,1999:blog-9018177553228445423.post-29548145650414372102015-10-25T08:15:00.003-07:002015-11-11T00:34:06.594-08:00What are the various types of validation controls provided by ASP.NET?<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="font-family: Verdana, Tahoma, Arial, sans-serif;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg15Of7LUlw8rv_Oe2yksbkGCeBAsFYdy93EzsDfEKGByM5ayjRu96qv00X2diaMrxIE7xOfcssKQZkb2sbWdVm7irvpND39cgl4oUnye7DUYU0mg_5KH19_7cdAd68t9S0x9SWevVYNp7e/s1600/.net+interview.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="234" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg15Of7LUlw8rv_Oe2yksbkGCeBAsFYdy93EzsDfEKGByM5ayjRu96qv00X2diaMrxIE7xOfcssKQZkb2sbWdVm7irvpND39cgl4oUnye7DUYU0mg_5KH19_7cdAd68t9S0x9SWevVYNp7e/s320/.net+interview.jpg" width="320" /></a></div>
<h2>
</h2>
<h2 style="text-align: left;">
<span style="color: #666666;"><span style="font-family: "verdana" , "sans-serif"; font-size: large;"><span id="Span171"><span class="paratitle1" id="Span173">What are the various types of validation controls provided by ASP.NET? </span></span></span></span></h2>
<span style="color: #666666;"><span style="font-family: "verdana" , "sans-serif"; font-size: large;"><span id="Span171"><span class="paratitle1" id="Span173">ASP.NET provides 6 types of validation controls as listed below:<br /><br /><b>1) RequiredFieldValidator</b> - It is used when you do not want the container to be empty. It checks if the control has any value or not.<br /><br /><b>2) RangeValidator</b> - It checks if the value in validated control is within the specified range or not.<br /><br /><b>3) CompareValidator </b>- Checks if the value in controls matches some specific values or not.<br /><br /><b>4) RegularExpressionValidator</b> - Checks if the value matches a specific regular expression or not.<br /><br /><b>5) CustomValidator</b> - Used to define User Defined validation.<br /><br /><b>6) Validation Summary</b> -Displays summary of all current validation errors on an ASP.NET page.</span></span> </span></span><br />
<span style="color: #666666;"><span style="font-family: "verdana" , "sans-serif"; font-size: large;"><br /></span></span>
<span style="color: #666666;"><span style="font-family: "verdana" , "sans-serif"; font-size: large;"><br /></span></span>
<br />
<div>
<span style="font-size: small;"><span style="color: #666666;"><span style="font-family: "verdana" , "sans-serif";"><br /></span></span></span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/18263131791214791311noreply@blogger.com4