Thursday, 14 May 2015

Write a c program to convert an input number to equivalent characters with a big a shape.

Program:

#include <stdio.h>
#include <stdlib.h>

void zero(int);
void one(int);
void two(int);
void three(int);
void four(int);
void five(int);
void six(int);
void seven(int);
void eight(int);
void nine(int);
void print(int,int);

int main()
{
    int num,rev=0,trev;
    int buff;
    int i=0,m=10;
    printf("Enter Number:");
    scanf("%d",&num);
    printf("\n");
    while(num>0){
        rev=(rev*m)+(num%10);
        num=num/10;
    }

    for(i=1; i<=5; i++){
        trev=rev;
        while(trev>0){
            buff=trev%10;
            trev=trev/10;
            print(buff,i);
        }
        printf("\n");
    }
    print("\n\n\n");
    return 0;
}

void print(int num,int r)
{
    switch(num){
    case 0:
        zero(r);
        break;
    case 1:
        one(r);
        break;
    case 2:
        two(r);
        break;
    case 3:
        three(r);
        break;
    case 4:
        four(r);
        break;
    case 5:
        five(r);
        break;
    case 6:
        six(r);
        break;
    case 7:
        seven(r);
        break;
    case 8:
        eight(r);
        break;
    case 9:
        nine(r);
        break;
    }
    printf("  ");
}

void zero(int row){
    switch(row){
    case 1:
        printf("000");
        break;
    case 2:
        printf("0 0");
        break;
    case 3:
        printf("0 0");
        break;
    case 4:
        printf("0 0");
        break;
    case 5:
        printf("000");
        break;
    }
}

void one(int row){
    switch(row){
    case 1:
        printf("1");
        break;
    case 2:
        printf("1");
        break;
    case 3:
        printf("1");
        break;
    case 4:
        printf("1");
        break;
    case 5:
        printf("1");
        break;
    }
}

void two(int row){
    switch(row){
    case 1:
        printf("222");
        break;
    case 2:
        printf("  2");
        break;
    case 3:
        printf("222");
        break;
    case 4:
        printf("2  ");
        break;
    case 5:
        printf("222");
        break;
    }
}

void three(int row){
    switch(row){
    case 1:
        printf("333");
        break;
    case 2:
        printf("  3");
        break;
    case 3:
        printf("333");
        break;
    case 4:
        printf("  3");
        break;
    case 5:
        printf("333");
        break;
    }
}

void four(int row){
    switch(row){
    case 1:
        printf("4 4");
        break;
    case 2:
        printf("4 4");
        break;
    case 3:
        printf("444");
        break;
    case 4:
        printf("  4");
        break;
    case 5:
        printf("  4");
        break;
    }
}

void five(int row){
    switch(row){
    case 1:
        printf("555");
        break;
    case 2:
        printf("5  ");
        break;
    case 3:
        printf("555");
        break;
    case 4:
        printf("  5");
        break;
    case 5:
        printf("555");
        break;
    }
}

void six(int row){
    switch(row){
    case 1:
        printf("666");
        break;
    case 2:
        printf("6  ");
        break;
    case 3:
        printf("666");
        break;
    case 4:
        printf("6 6");
        break;
    case 5:
        printf("666");
        break;
    }
}

void seven(int row){
    switch(row){
    case 1:
        printf("777");
        break;
    case 2:
        printf("7 7");
        break;
    case 3:
        printf("  7");
        break;
    case 4:
        printf("  7");
        break;
    case 5:
        printf("  7");
        break;
    }
}

void eight(int row){
    switch(row){
    case 1:
        printf("888");
        break;
    case 2:
        printf("8 8");
        break;
    case 3:
        printf("888");
        break;
    case 4:
        printf("8 8");
        break;
    case 5:
        printf("888");
        break;
    }
}

void nine(int row){
    switch(row){
    case 1:
        printf("999");
        break;
    case 2:
        printf("9 9");
        break;
    case 3:
        printf("999");
        break;
    case 4:
        printf("  9");
        break;
    case 5:
        printf("999");
        break;
    }
}

Output:




Thanks for watching.... Leave a comment....

Wednesday, 29 April 2015

Design a Simple Calculator using Visual Basic Language.


  •  Design a user interface as following:




  • Programs:


Public Class frmSimpleCalculator

    Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
        Dim a, b, c As Double
        a = txtNum1.Text
        b = txtNum2.Text
        c = a + b
        txtOutput.Text = a & "+" & b & "=" & c
    End Sub

    Private Sub btnSubs_Click(sender As Object, e As EventArgs) Handles btnSubs.Click
        Dim a, b, c As Double
        a = txtNum1.Text
        b = txtNum2.Text
        c = a - b
        txtOutput.Text = a & "-" & b & "=" & c
    End Sub

    Private Sub btnMul_Click(sender As Object, e As EventArgs) Handles btnMul.Click
        Dim a, b, c As Double
        a = txtNum1.Text
        b = txtNum2.Text
        c = a * b
        txtOutput.Text = a & "x" & b & "=" & c
    End Sub

    Private Sub btnDiv_Click(sender As Object, e As EventArgs) Handles btnDiv.Click
        Dim a, b, c As Double
        a = txtNum1.Text
        b = txtNum2.Text
        c = a / b
        txtOutput.Text = a & "/" & b & "=" & c
    End Sub
End Class

Monday, 31 March 2014

Write a c program to make animated Star

Program:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>
#include<math.h>

void g1(int,int,int);
void star(int,int,int,int);
void swapABC();
int a=1,b=2,c=3;

int main(){
 int gd=DETECT,gm;
 int i;
 initgraph(&gd,&gm,"C:\\Turboc3\\BGI");
 for(i=0; i<10; i++){
  g1(100,100,WHITE);
  swapABC();
 }
 getch();
 closegraph();
 return 0;
}

void g1(int x,int y,int color){
  int i=0;
  for(i=0; i<=60; i++){
   cleardevice();
   star(x,y,5+(i/2)*a,color+i+0);
   star(x+150,y,5+(i/2)*b,color+i+1);
   star(x+300,y,5+(i/2)*c,color+i+2);
   star(x+75,y+75,5+(i/2)*a,color+i+1);

   star(x,y+150,5+(i/2)*c,color+i+3);
   star(x+150,y+150,5+(i/2)*b,color+i+4);
   star(x+300,y+150,5+(i/2)*b,color+i+5);
   star(x+225,y+75,5+(i/2)*a,color+i+1);

   moveto(200,400);
   outtext("Twincle Twincle Little Star.");
   setcolor(color+i);
   moveto(250,420);
   outtext("-Asif (www.mrasif.in)");
   delay(50);
  }
  for(i=60; i>=0; i--){
   cleardevice();
   star(x,y,5+(i/2)*a,color+i+0);
   star(x+150,y,5+(i/2)*b,color+i+1);
   star(x+300,y,5+(i/2)*c,color+i+2);
   star(x+75,y+75,5+(i/2)*a,color+i+1);

   star(x,y+150,5+(i/2)*c,color+i+3);
   star(x+150,y+150,5+(i/2)*b,color+i+4);
   star(x+300,y+150,5+(i/2)*b,color+i+5);
   star(x+225,y+75,5+(i/2)*a,color+i+1);

   moveto(200,400);
   outtext("Twincle Twincle Little Star.");
   setcolor(color+i);
   moveto(250,420);
   outtext("-Asif (www.mrasif.in)");

   delay(50);
  }
}

void star(int x,int y,int l,int color){
 int ox=(l/2);
 int oy=(sqrt(pow(l,2)-(pow((int)(l/2),2))))/3;
 x=x-ox,y=y-oy;
 setcolor(color);
 putpixel(ox+x,oy+y,color);
 line(x,y,x+l,y);
 line(x,y,x+((int)l/2),y+(sqrt(pow(l,2)-(pow((int)(l/2),2)))));
 line(x+((int)l/2),y+(sqrt(pow(l,2)-(pow((int)(l/2),2)))),x+l,y);
 y=y+((sqrt(pow(l,2)-(pow((int)(l/2),2))))*2/3);
 line(x,y,x+l,y);
 line(x,y,x+((int)l/2),y-(sqrt(pow(l,2)-(pow((int)(l/2),2)))));
 line(x+((int)l/2),y-(sqrt(pow(l,2)-(pow((int)(l/2),2)))),x+l,y);
}
void swapABC(){
 int temp=a;
 a=b;
 b=c;
 c=temp;

}

Output:

Saturday, 11 January 2014

Send email using telnet using any email server

To send mail using telnet at first you should install windows component Tel Net Server & Tel Net Client.
Then follow only 8 steps-
Step 1: Type "telnet -l <username> <hostname> <port>" then press enter.
Step 2: Type "Helo Asif" and press Enter.
Step 3: Type "MAIL FROM: <mail id>" and press Enter.
Step 4: Type "RCPT TO: <mail id>" and press Enter.
Step 5: Type "DATA" and press Enter.
Step 6: Type "Subject: <subject>" and press Enter then type your message then press Enter.

Step 7:  Type "quit" to Quit and press Enter.
Step 8: Your e-mail have been sent.

Thank you for watching... Comment it.
To join us visit www.famoussoft.com.

Friday, 13 September 2013

Write a VB Script program to accept a value & check whether it is a numeric or not and display the value is positive or negative

Index.html
--------------------
<html>
<head>
<title>VB Script By Asif</title>
<script language="VBScript">
Sub asif
    Dim TheForm
    Set TheForm=Document.forms("Form1")
    If IsNumeric(TheForm.Text1.Value) Then
        If cint(TheForm.Text1.Value)<0 Then
            MsgBox "This is a Negative number !"
        Else
            MsgBox "This is a Positive number !"
        End If
    Else
        MsgBox "This is a Text !"
    End If
End Sub
</Script>
</head>
<body>
<form name="Form1">
Number1:<input type="text" name="Text1"/><br/>
<input type="button" name="Button1" value="Check"/>
<script for="Button1" event="onClick" language="VBScript">
Call asif
</script>
</form>

</body>
</html>


Input:

5
Output:
This is a Positive number !

Input:
-5
Output:
This is a Negative number !

Input:
A
Output:
This is a Text !