Friday 30 April 2021

Implicit and Explicit type conversion | C Language

 Implicit and Explicit type conversion | C Language

Converting one data type into another data type is known as type conversion or typecasting. For example, converting character to number type integer. A waterfall model has been used for type conversion, which guaranteed that no loss of data while conversion.  If you convert the higher data type to a lower data type then data loss will occur, for example, conversion of long to an integer.

Implicit and Explicit type conversion | C Language




Implicit Typecasting

Implicit type casting means conversion of data types without losing its original meaning. This type of typecasting is essential when you want to change data types without changing the significance of the values stored inside the variable.

 

Tuesday 27 April 2021

Advantage of Pointer | C Language

Advantage of Pointer

  • It provides dynamic programming environment.
  • Physical location of memory can be direct access through pointer.
  • It allow to call by reference to function which help to achieved many dynamic operation.
  • Dynamic memory allocation is achieved through array.
  • Fire read write operations are achieved through pointer.
  • Management of structures which are allocated memory dynamically is efficiently achieved by pointer.

Sunday 25 April 2021

File read write function | C Language

1. ftell()

Returns the current file pointer position in numeric form. 

 Declarationlong ftell(FILE *stream);

 

 Remarks:

ftell returns the current file pointer for stream.If the file is binary, the offset is measured in bytes from the beginning of

the file The value returned by ftell can be used in a subsequent call to fseek.

 

 Return Value:

   On success, returns the current file pointer position.

   On error, returns -1L and sets errno to a positive value.

 

Example

 

    #include <stdio.h>

 

int main(void)

{

   FILE *stream;

 

   stream = fopen("MYFILE.TXT", "w+");

   fprintf(stream, "This is a test");

   printf("The file pointer is at byte %ld\n", ftell(stream));

   fclose(stream);

   return 0;

}

2. rewind()

Repositions file pointer to stream's beginning

 

 Syntax:

  void rewind(FILE *stream);

 

 Remarks:

rewind(stream) is equivalent to   fseek(stream, 0L, SEEK_SET) 

except that rewind clears the end-of-file and error indicators, while fseek

only clears the end-of-file indicator. 

After rewind, the next operation on an update file can be either input or

output.

 

Example

 

 #include <stdio.h>

 #include <dir.h>

 

 int main(void)

 {

    FILE *fp;

    char *fname = "TXXXXXX", *newname, first;

 

    newname = mktemp(fname);

    fp = fopen(newname,"w+");

    fprintf(fp,"abcdefghijklmnopqrstuvwxyz");

    rewind(fp);

    fscanf(fp,"%c",&first);

    printf("The first character is: %c\n",first);

    fclose(fp);

    remove(newname);

 

    return 0;

}

 

Next Topic

Thursday 22 April 2021

Memory Allocation Function

 

1. Malloc

Full form of malloc function is memory allocate. malloc allocates a block of size bytes from the memory heap. It allows a program to allocate memory explicitly as it's needed, and in the exact amounts needed.

PHP 404 page handling

 

PHP 404 page handling

Server shows 404 error code when requested resource not found at server. By default, the browser display 404 error page .which is not as user-friendly because it does not show our website look and layout. if you want to custom 404-page handling page then this post will help you. to do the above let follows the steps given below.

Tuesday 20 April 2021

Custom Error message | Hide Yellow Screen Of Death (YSOD) page in ASP .Net

ASP.Net MVC has a default error view in the Shared folder. which shows when any unexpected error arises. By default a fixed static error message display, No details of error shows. So if you want to show error details then this post will help you.




Yellow Screen Of Death (YSOD)

When an unhandled exception arises in an ASP.NET application one of three types of error pages is displayed: By default, ASP.NET displays an error page that is affectionately referred to as the Yellow Screen of Death (YSOD). YSOD showed some Sensitive information that can be used by attackers . Show its good practice to show custom error info in front of your users.

Setting in Webconfg file

<system.web>

    <compilation debug="true" targetFramework="4.7.2" />

    <httpRuntime targetFramework="4.7.2" />

       <trust level="Full" />

      

       <customErrors mode="RemoteOnly"

                      defaultRedirect="~/Shared/Error.cshtml" />

  </system.web>


Show error in custom error file



 @model System.Web.Mvc.HandleErrorInfo 

<div class="container">       

        <h1>Error.</h1>

        <h2>An error occurred while processing your request.</h2>

        <h3 style="color:red"><p style="color:red"> @Model.Exception.Message</p></h3>

        <br /><br />

    </div>

Next Topic

Sunday 18 April 2021

Array an introduction | C Language

 


Array

An array is a collection of similar data type which occupies continuous location on memory. Array is useful bulk process is required on similar data type. Name of array is a constant pointer which point first element of array. Elements of array are access through index number. Index donates numeric position of data in an array. Index start with zero and last element less than one from the specified size of array.

Syntaxt :

Data_type arr_name[size_int]


 

 

Tuesday 13 April 2021

Answer : PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE , January 2020 | NIELIT O Level

Answer : PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE , January 2020 | NIELIT O Level

1. Objective Answer

1.1 : B
1.2 : D
1.3 : C
1.4 : B
1.5 : B
1.6 : C
1.7 : C
1.8 : C
1.9 : C
1.10 : B

Sunday 11 April 2021

Develop a flowchart to find out the minimum of the given three numbers.

  Develop a flowchart to find out the minimum of the given three numbers.



Saturday 13 February 2021

Real Estate PHP project full source code Free Download | Free PHP Project

 


Real Estate PHP Project

This real estate project is created to cover the student project as well as handling real estate projects. The project is diveded into a two-part, website and CRM. The website will cover online presentations of projects in front of clients. CRM covers business internal operations. This project is live and used by many customers. Purpose of this project to post here, for the learning  purpose of students that  How real estate operations being handled by the Online website. Any commercial uses of this project are prohibited and any violence of agreement is found then legal action may charge against of user.

Sunday 7 February 2021

Solved : PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE , January 2020 | NIELIT O Level


Solved : PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE , Jan 20

1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the “OMR” answer sheet supplied with the question paper, following instructions therein.

1.1 : What is the following is invalid header file in C ?
         (A) math.h (B) mathio.h
         (C) string.h (D) ctype.h

Sunday 3 January 2021

2d Matrix sum using array | C Language | Nielit O Level Question

 Q : write a program to sum 3x3 matrix using an array.


2d matrix sum using array


Solution : 

#include<stdio.h>

#include<conio.h>

Saturday 28 November 2020

ASP.Net 404 page not found error handle

 



When a URL hits and if page is not found on the server then ASP.Net throws a 404 page not found exception. If 404 page not found exception handled properly then you will get the default error page by ASP.Net , Which doesn't looks good and user friendly. 404-page handling is considered as a good practice of web development. Paste the following code on Global asax file and you will be redirected to your custom error page. 

Tuesday 10 November 2020

Google Captcha for C# ASP.Net MVC

 

reCAPTCHA uses an advanced risk analysis engine and adaptive challenges to keep malicious software from engaging in abusive activities on your website. Meanwhile, legitimate users will be able to login, make purchases, view pages, or create accounts and fake users will be blocked.

Saturday 7 November 2020

HTML Table to Excel


jquery.table2excel.min.js is jquery library which has inbuilt functionality to expert any HTML table to Excel file by table id. This is one of the simplest solutions available on the internet totally free of cost. 


 <html>
<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Girfa HTML to Excel</title>

     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"> </script>

<script src="https://cdn.rawgit.com/rainabba/jquery-table2excel/1.1.0/dist/jquery.table2excel.min.js"> </script>

<script>  

  function tbltoexcel()

Monday 5 October 2020

Form post ASP.Net | C# | MVC

 


HTTP is a protocol that is used to provide a communication interface between server and client. HTTP sends data to the server and retrieved response to the client(Browser). HTTP has many methods for client/server communication.

HTTP GET and HTTP Post is the most common method used by HTTP. 

  • HTTP Get the return response from the server to  client.
  • HTTP Post send data client (Browser to the server) .
I am going to explain to you that how can you save data of a form using form post methods. I was a PHP developer when used the MVC C# form then I had to use ajax for data submission to the server which was very time taking and prone to error.


ASP.Net MVC C# has a built-in model attached view for form data submission and validation, which is good but not good as for users who are using simple posts form the method. So I will show you different ways to send data to the server using form method post like PHP.

Demo Table Name (Student)


SN

Field

Data Type

1

Roll

Int

2

Name

Varchar(50)

3

City

Varchar(50)

Store Procedure

Wednesday 16 September 2020

Column to row transform in SQL Server

 Q :  In an organization,  staff tasks had been assigned through CRM and task status (New, Complete, Pending) submitted to CRM back. Now Admin want to see the every staff task status New, Compare and pending order with staff name

Table Structure

Wednesday 9 September 2020

Get Date dd/mm/yy format using format string C# | ASP.Net

ASP.Net has reach variety of date processing techniques . If yoo want to date as in dd-mm-yy format then you can use format string which help you to set your date output as you want. Using format string increase your ourput by just a line of code.

DateTime dt = DateTime.Now;

string format = "ddmmyy";

string postfix = dt.ToString(format);    

Output : 110920        

Console.WriteLine(postfix);

You can use different versions of format string as per your requirement . 

string format = "dd-mm-yy";
Output : 09-11-20

string format = "DDD mm yy";
Output : Wed 09 20

Format string pattern

M display one-digit month number d display one-digit day of the month h display one-digit hour on 12-hour scale mm display two-digit minutes yy display two-digit year

Saturday 5 September 2020

Bind dynamic layout on a single view using C# | ASP.Net

 

ASP.Net MVC is a popular platform to design dynamic website and CRM etc. One I was stuck in a situation when I want to use a common view to different privileged users. So I had to bind multiple layouts on a single view as per the related users menu or sidebar. This post will help you to bind dynamic layouts on a single view.

  public ActionResult Task()

        {

File Resizing C# | ASP.NET | MVC

 

You can resize your image as per your requirement by using WebImage Class which implemented in System.Web.Helpers namespace and resizing is done by Resize and save method.

Namespace : using System.Web.Helpers;

[HttpPost]

        public JsonResult UploadCommonImage(string fnm, string pth,string w,string h)

        {