Here, We are performing push and pop operation of stack. #include<stdio.h> #include<conio.h> void push(); void pop(); void main() { int ch,c; clrscr(); do { printf("\n***SELECT OPERATION OF STACK**\n"); printf("\n1.PUSH OPERATION\n2.POP OPERATION\n"); printf("\nEnter you choice::"); scanf("%d",&ch); switch(ch) { case 1: push(); break; case 2: pop(); break; default: printf("\n**INVALID CHOICE**\n"); } printf("\nDOU YOU WANT TO QUIT(0 or 1)::"); scanf("%d",&c); }while(c==0); } void push() { int a[10],n,i,top=-1,no; printf("\n***PUSH OPERATION**\n"); printf("\nEnter the size of array::"); scanf("%d",&n); printf("\n**Enter array elements**\n"); for(i=0;i<n;i++) { scanf("%d",&a[i]); top++; } printf("\nEnter element to insert::"); scanf("%d",&no); if(top>=n) { printf("\n**STACK IS OVERFLOW**\n"); } else { top++; a[top]=no; } printf("\n***AFTER POUSH OPERATION**\n"); for(i=0;i<=top;i++)…
-
-
Here, gettype() function is used to get the datatype of the variables. Syntax gettype($variable); <?php $a=10; $b=10.98; $c="Hello"; echo "$a is ".gettype($a); echo "<br> $b is ".gettype($b); echo "<br> $c is ".gettype($c); ?> OutPut 10 is integer 10.98 is double Hello is string
-
Here, Dot(.) is used to concate the statements. <br> tag is used to break the line. <?php $a=10; $b=20; echo "Value of a = $a"."<br>"; echo "Value of b = $b"."<br>"; echo "<br> ***Arithmetic Operator*** <br>"; $c=$a+$b; echo "Addition of $a and $b = $c"."<br>"; $c=$a-$b; echo "Subtraction of $a and $b = $c"."<br>"; $c=$a*$b; echo "Multiplication of $a and $b = $c"."<br>"; $c=$a/$b; echo "Division of $a and $b = $c"."<br>"; echo "<br> ***Comparison Operator*** <br>"; if($a>$b) { echo "$a is greater than $b <br>"; } else if($a<$b) { echo "$a is less then $b <br>"; } else if($a==$b)…
-
Here echo is used to print something in output console. $ is used with variable, in PHP all variables are precedes with $ sign, you have to use $ with all variables. Every line of code must be ended with semicolon (;). Note that every PHP Script must start with <?php and ended with ?>, this means whole script must be written between <?php …. ?>. <?php $a= "Hello World!"; echo $a."<br>"; ?> OutPut Hello World!
-
Here, <link> tag contains rel attribute which is used to control printing of various language. <html> <head> <title>Google</title> <link rel="stylesheet"href="https://fonts.googleapis.com/css?family=Tangerine"> </head> <body> <table align="right" cellpadding="5" cellspacing="5" > <td><a href="" style="color:black;text-decoration:none">Gmail</a></td> <td><a href="" style="color:black;text-decoration:none">Images</a></td> <td><img src="gmenu.png" style="width:25px ; height:25px" /> <td><input type="submit" value="Sign in" style="width:70px ; height:30px;background- color:#4c4cff; color:#FFFFFF;border:none; border-radius:3px;font-weight: bold" /></td> </table> <div align="center" style="padding:130"> <img src="Google.png" style="width:430px ;height:140px;margin-left:90" /> <input type="search" style="width:550px; height:42px; background:transparent;border:2px outset #f1f4f2;margin-left:100" /> <img src="voice.png" style="width:20px ; height:30px" /><br><br> <input type="submit" name="search" value="Google Search" style="width:130px; height:35px; background-color:#f1f4f2;border:none;border-radius:3px;color:#6f8877;font-weight: bold;margin-top:20;margin-left:90"> <input type="submit" name="lucky" value="I'm Feeling Lucky" style="width:130px; height:35px; background-color:#f1f4f2;border:none;border-radius:3px;font-weight: bold;color:#6f8877"> <table style="margin-left:120;font-size:15"> <td>Google offered in :</td> <td><a…
-
<div> tag is used to create the container in webpage. It will used to design some portion of webpage. <html> <head> <title>Content</title> </head> <body bgcolor="brown"> <div style="background-color:grey;color:white;font-size:25px" align="center"> <p>Different Types Of Functions Are Displayed Here...</p> <p>Content Display Here</p></h1> </div> </body> </html> OutPut
-
<html> <head> <title>Contact Form</title> <style type="text/css"> td { font-size: 15pt; } </style> </head> <body align="center" bgcolor="#83ccd2"> <h2><b><u>CONTACT FORM</u></b></h2> <form method="post" name="contactform" action="cform.php"> <table align="center" border=3 bordercolor="black"> <tr> <td>Name : </td> <td><input type="text" name="name" placeholder="Firstname Secondname Lastname" size="40" required></td> </tr> <tr> <td>Email : </td> <td><input type="email" name="email" placeholder="abc123@gmail.com" size="40" required></td> </tr> <tr> <td>Mobile No. : </td> <td><input type="number" name="mno" placeholder="0123456789" required></td> </tr> <tr> <td>Message : </td> <td><textarea rows="7" cols="25" name="msg" placeholder="Write Your Message Here"></textarea></td> </tr> <tr> <td><input type="submit" name="submit" value="SUBMIT"></td> <td><input type="reset" name="reset" value="RESET"></td> </tr> </table> </form> </body> </html> OutPut
-
<style> tag is used to apply the css. <form> tag is used to used form attributes. <table> tag is used to create table. <tr> tag creates the row and <td> tag is used to create the column. <th> tag is used to apply header row for table. <html> <head> <title>Feedback Form</title> <style type="text/css"> td { font-size: 15pt; } </style> </head> <body align="center" bgcolor="#cd93cc"> <h2><b><u>FEEDBACK FORM</u></b></h2> <form method="post" name="feedbackform" action="fform.php"> <table align="center" border=3 bordercolor="black"> <tr> <td>Name : </td> <td><input type="text" name="name" placeholder="Firstname Secondname Lastname" size="40"></td> </tr> <tr> <td>Enrollment No. : </td> <td><input type="number" name="mno" placeholder="166470307001"></td> </tr> <tr> <td>Email : </td> <td><input…
-
<a> tag is used to use hyperlink, href attribute contains the actual link. <img> tag is used to display image, src attributes contains the actual link. imageDemo.html <html> <head> <title>Image Link Demo</title> </head> <body bgcolor="#f5e44c" align="center"> <br/><h1><u>Display Image Demonstrate Hyper Linking</u></h1> <h2>Click on image or link to get motivational videos....</h2><br/> <a href="videoDemo.html"><img src="sandip2.jpg" width="400" height="400"></a> <br/><h3><a href="videoDemo.html">SANDIP MAHESHWARI</a></h3> </body> </html> videoDemo.html There are three ways to display video using HTML. <video> tag <embed> tag <iframe> tag <video> tag is used to display video, <video> tag contains <source> tag that takes src attribute to provide link of video. <embed> tag directly takes src…
-
Basically, the one screen of mobile is knows as Activity in Android. Android Activity Lifecycle is controlled by 7 methods which are included in android.app.Activity class. The android Activity is the subclass of ContextThemeWrapper class. An activity is the single screen in android. It is like window or frame of Java. By the help of activity, you can place all your GUI components or widgets in a single screen. The activity goes from one state to another which is known as activity lifecycle. Methods Of Activity Lifecycle Method Description onCreate called when activity is first created. onStart called when activity…