.

.

Wednesday

C program to check leap year



The logic of leap year is that, a years which is perfectly divisible by 4 but not by 100 is leap year but a year which is divisible by both 100 and 4,then it can be a leap year if it is divisible by 400.

Here is the C programming code to check whether it is leap year or not.To run this programming just copy the 
bellow code and pest it on turbo c or any else application you use :

#include <stdio.h>

#include <conio.h>

void main()

{

 int y;
  printf("Enter a year to check if it is a leap year\n");

  scanf("%d", &y);

  if ( y%400 == 0)

  printf("%d is a leap year.\n", y);

  else if ( y%100 == 0)

  printf("%d is not a leap year.\n", y);

  else if ( y%4 == 0 )

  printf("%d is a leap year.\n", y);

  else

  printf("%d is not a leap year.\n", y);


  getch();

}

The Output of this program will look like this :





If you have any more thoughts and query about this post please comment

Swapping of two numbers in C

Swapping means simply exchanging the values of two variable.The 5 different method of swapping have
 shown bellow:

  • Using Third Variable
  • Without Using Third Variable
  • Using  Pointer
  • Using Function using Call by Reference

Using Third Variable:

Assume that you have cup A filled with water and cup B filled with milk, now to swap or exchange content
 of both cups just take cup C and pour the content of cup B into it , now pour the content of cup A into cup
 B and then pour the content of cup C into cup A.
Thus you have swapped the content of cup A and cup B.Similarly using third variable you can swap the
 values of two variable.The c programming code is given bellow..

C Program to Print Different Patterns

These program prints various different patterns of numbers and stars.



*
**
***

Monday

How to Create a Browser in VB6


This tutorial is about how to create a simple browser in vb 6.



  • First open a form in VB 6. 
  • Add a Text box and 3 Buttons,change their caption to Go, Back, Forward and Refresh and name them cmdgo,cmdback,cmdforward and cmdrefresh.

Sunday