Friday, 12 February 2016

HTML CODE FOR FORM IN CENTER (FROM ALL SIDE )

<html>
<head><title>Hello Gaurav</title></head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr><td align="center" valign="middle">
<table border="1" width="300">
<tr><td>Hey look at me! I'm in the middle!</td></tr>
</table>
</td></tr>
</table>
</body>
</html>

Saturday, 6 February 2016

What are the differences between %f, %e and %g format specifiers in C language? Explain with examples in which these format specifiers are emplyed.

  1. %f prints the corresponding number as a decimal floating point number (e.g. 321.65),
  2.  %e prints the number in scientific notation (e.g. 3.2165e+2), 
  3. %g prints the number in the shortest of these two representations (using the same number, the decimal floating point is shorter and hence 321.65 would be printed.  An example where %g would print the scientific notation is when the number is 6000000000.  In scientific notation, this would 6e+9 which is shorter and hence, 6e+9 would be printed.)
  4. The only difference between the lower case %e, %g and the upper case versions %E, %G is that printing scientific notation will use an upper case E instead of a lower case e to indicate the exponent.  E.g.  %E produces 3.2165E+2 when %e produces 3.2165e+2.

Friday, 5 February 2016

Right program of goto keyword

int main()
{
   int age;
   

   printf("Enter you age:");
   scanf("%d", &age);
   if(age>=18)
        goto Vote;
   else
        goto NoVote;
Vote:
     printf("you are eligible for voting");
     exit();
   NoVote:
     printf("you are not eligible to vote");
    exit();
return 0; }

Best example of goto keyword

Program to Print whether the number is even or odd 

#include<stdio.h> 
main(){
int n;
printf(''Enter the number :");
scanf("%d",&n);
if(n%2= = 0){
goto even;
}
else{
goto odd;

}

even  : 
printf("Number is even");

goto end;

odd : 
printf("Number is odd ");
goto end;

end: 
printf("\n");

getch();
return 0;


}