Archive for December 2011
27
Dechow to find maximum number?
0 Comments | Posted by ravinakalkani in C language, Uncategorized
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b;
printf(“enter the number:-”);
scanf(“%d”,&a);
printf(“enter the number:-”);
scanf(“%d”,&b);
if(a==b)
{
printf(“a,b are equal”);
}
else
{
if(a>b)
{
printf(“a is max”);
}
else
{
printf(“b is max”);
}
}
getch();
}
27
Dec:How will you apply view state at page level as well as at control level?
0 Comments | Posted by muskanpatil in Asp.Net
· Viewstate is one of the most important and useful client side state management mechanisms.
· It can store the page value at the time of post back of your page.
· ASP.NET pages provide the View State property as a built-in structure for automatically storing values between multiple requests for the same page.
· There are two level of view state:
1. Page level
2. Control level
· Page Level view state control treat as highest priorities.
· Which means If we set EnableViewState= “False” in page level, that will automatically be derived by all the server side controls. In that case, if we set EnableViewState=”True” for any server side control will treat it as false, as we have defined them “False” in Page Level.
· Apply the view state at page level:
o Page level means apply viewstate property to page.
o To apply the viewstate at page level set the property EnableViewState of page
o Now , if set the EnbleViewState property = “true” then all the server control derived this property as true.
o If we set the EnbleViewState property = “false” then all the server control derived this property as false.
· Apply the view state at control level:
o Control level means apply viewstate property on controls used in page.
o To apply the viewstate at control level then set the enableviewstate property of each control on which you want to set.
o Ex. <asp:DropDownList ID=”DropDownList1″ runat=”server” EnableViewState=”true”> </asp:DropDownList>
o If you apply page level as false then this property will not work because pagelevel has high priority.
27
DecExplain Break and Continue statement with example?
0 Comments | Posted by kananiprabodh in Java
Break and Continue statement are jumping statement. Java supports following three jumping statements:
1. Break
2. Continue
3. Return
Break : -
The break statement has three uses :
a) It terminates a statement sequence in a switch statement
b) It can be used to exit a loop
c) It can be used as a “civilized” form of goto
Example :
Terminates a statement sequence in a switch statement :
When a break statement is encountered, execution branches to the first line of code that follows the entire switch statement.
Class switching
{
Public static void main (String args[])
{
Switch (wash)
{
case 1:
System.out.println("Cotton selected");
break;
case 2:
System.out.println("Linen selected");
break;
case 3:
System.out.println("Wool selected");
break;
default:
System.out.println("Selection error");
break;
}
}
}
Using break to exit a loop
Using break, you can force immediate termination of a loop by passing the conditional expression and any remainder code in the body of the loop.
Class exloop
{
Public static void main (String args[])
{
For (i=0;i<=10;i++)
{
If (i==5)
Break;
System.out.println(i)
}
}
}
Using break as form of goto:
Java does not have a goto statement because it provides a way to branch in an arbitrary and unstructured manner. Using break, you can break out of any block. Break works with label. General form of the labelled break is
Break label;
When labelled break executes, control is transferred out to named block.
Class breaklabel
{
Public static void main (String args[])
{
Boolean t=true;
First :
{
Second :
{
Third :
{
System.out.println(“Before Break”);
If (t) break second;
System.out.println(“No Use”);
}
System.out.println(“No Use”);
}
System.out.println(“This is after use”);
}
}
}
Continue:
Continue statement is used to continue running the loop but stop processing the remainder of the code in its body for this particular iteration.
In while and Do-While loop, a continue statement causes control to be transferred directly to the conditional expression that controls the loop.
In For loop control goes first to iteration portion of the for statement and then to the conditional expression.
Example:
Class continueuse
{
Public static void main ( String args[])
{
For ( int i=0;i<10;i++)
{
System.out.println(I + “ “);
If (i%2==0)
Continue;
System.out.println(“ “);
}
}
}
#include<stdio.h>
#include<conio.h>
void f1();
void main()
{
printf(“hello”);
}
void f1()
{
printf(“function is called”);
}
25
DecNew Technology – Classroom7 technical demo – [video]
0 Comments | Posted by kananiprabodh in Technology News, Windows Phone 7
Classroom7 is the cloud based learning system which can add interaction and collaboration between student .
![[del.icio.us]](http://www.itshala.com/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.itshala.com/wp-content/plugins/bookmarkify/digg.png)
![[dzone]](http://www.itshala.com/wp-content/plugins/bookmarkify/dzone.png)
![[Facebook]](http://www.itshala.com/wp-content/plugins/bookmarkify/facebook.png)
![[Google]](http://www.itshala.com/wp-content/plugins/bookmarkify/google.png)
![[LinkedIn]](http://www.itshala.com/wp-content/plugins/bookmarkify/linkedin.png)
![[Twitter]](http://www.itshala.com/wp-content/plugins/bookmarkify/twitter.png)
![[Windows Live]](http://www.itshala.com/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://www.itshala.com/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.itshala.com/wp-content/plugins/bookmarkify/email.png)
