Friday, March 8, 2013

Complete Code : Take temperature in Fahrenheit as input and convert it into Centigrade and Kelvin. Display the conversion results at the end.

Program Sample Output
 
Sample Input: (Note: Bold refers to user input)

Enter Temperature in Fahrenheit: 32

Sample Output:

Centigrade : 0.00 °C
Kelvin : 273.00 K

Note: The character ‘°’ should also be printed in the output.

CODE

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>

main()
{
      float fTemp=0;
      cout<<"Enter temp in Fahrenheit : ";
      cin>>fTemp;
      float cTemp=(fTemp-32)*5/9;
      float kTemp=cTemp+273;
      printf("\nTemp is Centigrade is %f %cC",cTemp,248);
      printf("\nTemp is Kelvin is %f %cC",kTemp,248);
      getche();
}

Download this project's executable file from HERE

NOTE:You will need Dev C++ or TC compiler to compile this code.

Thursday, March 7, 2013

Ask the user for his/her marks in CP Midterm #1 (out of 60) and find out the percentage marks.

Program Sample Output

 e.g. 1
Sample Input: (Note: Bold refers to user input)
Enter your marks in “CP Midterm #1” : 25

Sample Output:
Your marks as a percentage are: 40.00 %

e.g. 2
Sample Input: (Note: Bold refers to user input)
Enter your marks in “CP Midterm #1”: 60

Sample Output:
Your marks as a percentage are: 100.00 %

  CODE
#include<iostream>
#include<conio.h>
#include<iomanip.h>

main()
{
       float marks;
       cout<<"Enter your marks in CP (Out of 60): ";
       cin>>marks;
       float result= (marks/60);
       cout<<"Your marks as a percentage are : "<<result*100;
       getche();
       return 0;    
}

Download this executable of this project from HERE

NOTE: You will need Dev C++ or TC compiler to compiler this code properly

Tuesday, March 5, 2013

Error 404.13 The request filtering module is configured to deny a request IIS

Hello folks,

          You might have encounter an error while uploading files to the server

"The request filtering module is configured to deny a request that exceeds the request content length"


so what does this error actually means, and how to solve this error..

Basically IIS has defined a size limit for uploading file, by default the size limit is 30000000 bytes i.e. 28 MB. So when ever a user try to upload a file that is larger than 28 MB this error will come up.

In order to fix this problem follow these simple steps.
  1. Click on start button and type inetmgr, this will open up the IIS Manager
Alternatively you can go to 

Control Panel >> Administrative Tools >> Internet Information Services (IIS) Manager 


     
     2.  Now from the right side window Double click on Request Filtering

     3.  Now Goto Rules Tab

     4.  Now right click and select Edit feature Setting

     5. Now set the "Maximum Allowed Content Length" according to your requirement


   
      6. Click on OK to finish

Note: It is recommended to restart the IIS after setting the value.

I hope this was informative for you and I would like to thank you for reading.

Saturday, March 2, 2013

Error 1935 while installating Visual Studio

Hello,
         Today while installing Visual Studio 2010 on my windows 7, I encountered an error

 Error 1935. An error occured during the installation of assembly 'VsWebSite.Interop,version="8.0.0.0",publicKey Token= "b03f5f7f11d50a3a",fileVersion="8.0.50727.932",culture="neutral"'. Please refer to Help and Support for more information. HRESULT: 0x80070005


I was curios to find what the actual problem in, because I had never received this kind of error before. So after a little bit of search I found that Error 0x8007005 indicates that

the setup was not executed with Administrator rights. 

This problem may comes up when you already had some features of VS installed, especially on windows 7

So I re-started the setup by right click and choose Run as administrator, and the whole setup went fine.

I hope this was informative for you and I would like to thank you for reading.

Friday, March 1, 2013

How to Redirect from Non-Exist url to a Existing One C#

Hello Everyone today I’m gonna teach you, if the user type a URL that doesn’t even exist, so how to rediect them to a Existing Page without showing them the default 404 Error Page.
We will use the web.config file for this purpose, this can also be done in IIS via URLReWrite

1. First Add 2 webpage and name them home.aspx and Error.aspx
2. Now open your web.config
3. Find <System.Web> tag
4.  Now place the following code inside the <System.Web> tag

   <customErrors mode="On">
   <error statusCode="404" redirect="Error.aspx"/>
   </customErrors>

This code will check the url , if the url exist than this code will do nothing, but if the page doesn’t exist it will rediect them to Error.aspx page.

Note

  •  Error Code 404 means Page Not Found
  • You can Change the StatusCode according to your requirements
  • If CustomErrors mode is set to Off than this rule will not do anything
Browser StatusCodes 
  • 1xx Informational
  • 2xx Success
  • 3xx Redirection
  • 4xx Client Error
  • 5xx Server Error
I hope this was informative for you and I would like to thank you for reading. If you still have any queries than do comment.