9 Nov 2013

BASIC program-3

to calculate 2 numbers

10 CLS
20 let a=30 : b=36 :c=a+b
30 print c
40 end

output
66

BASIC program-2

to display the bio data


10 rem to display bio-data of a student
20 print "name: Siva"
30 print "class:VI-A"
40 print "roll no: 1"
50 end
output
name: Siva
class:VI-A
roll no: 1

BASICprogramming


 first program of BASIC



10 REM "my first Q basic program"
20 PRINT"sivarajan"
30 END
output
sivarajan
note: download  Q  basic to write this program

c ++for c++ programmers

for finding the number <,>or =

#include "iostream.h"
#include "stdio.h"

void main( );
{
icin>>a
 cin>>b

if (a>B)
{
cout<<"greatest no =",a;
}
else if   (a<b)
{
cout<<("greatest no = ",b;
}
else if   (a=b)
{
cout<<"all are equal ";
}
else
{
cout<<"wrong input"
getchar( );
}
output
23
34
greatest no=34

8 Nov 2013

c program for programmers - 2



using math .h 

#include "stdio.h"
#include "math.h"
void main ( )
{
int a,b,c;
a= 10;
b=20;
c=a+b;
printf("sum=%d\n",c);
getchar( );
}
output
sum=30

note : 
  1. you  can  change  the  operator  symbol  like + : add , - :subtract ,  / : divide ,                                    * :  multiplication ; ^:exportation.
  2. if you want to write the numbers in decimals write for int write float in printf for %d write %f

c basic for programmers

c basic program for programmers

#include "stdio.h" 

void main ( )

 { 

printf("hello world");

 getchar ( ); 

}

output

hello world

caution:don't forget to put semicolon(;) and download turbo c++ for writing this program