Search This Blog

Sunday, December 11, 2011

test on c

Q1.
main()
{
int i;
clrscr();
printf("%d", &i)+1;
scanf("%d", i)-1;
}

a. Runtime error.

b. Runtime error. Access violation.
c. Compile error. Illegal syntax
d. None of the above





Ans: d,printf( ) prints address/garbage of i,

scanf() dont hav & sign, so scans address for i
+1, -1 dont hav any effect on code

Q2.

main(int argc, char *argv[])
{
 (main && argc) ? main(argc-1, NULL) : return 0;
}

a. Runtime error.

b. Compile error. Illegal syntax
c. Gets into Infinite loop
d. None of the above



Ans: b) illegal syntax for using return


Q3.

main()
{
 int i;
 float *pf;
 pf = (float *)&i;
*pf = 100.00;
 printf("
%d", i);
}

a. Runtime error.

b. 100
c. Some Integer not 100
d. None of the above




Ans: d) 0


Q4.


main()

{
 int i = 0xff ;
 printf("
%d", i<<2);
}

a. 4

b. 512
c. 1020
d. 1024




Ans: c) 1020



Q5.

#define SQR(x) x * x

main()

{
 printf("%d", 225/SQR(15));
}

a. 1

b. 225
c. 15
d. none of the above



Ans: b) 225



Q6.

union u
{
 struct st
{
 int i : 4;
 int j : 4;
 int k : 4;
 int l;
}st;
int i;
}u;

main()

{
 u.i = 100;
 printf("%d, %d, %d",u.i, u.st.i, u.st.l);
}

a. 4, 4, 0

b. 0, 0, 0
c. 100, 4, 0
d. 40, 4, 0



Ans: c) 100, 4, 0


Q7.

union u
{
 union u
 {
 int i;
 int j;
 }a[10];
 int b[10];
}u;

main()

{
 printf("
%d", sizeof(u));
 printf(" %d", sizeof(u.a));
// printf("%d", sizeof(u.a[4].i));
}

a. 4, 4, 4

b. 40, 4, 4
c. 1, 100, 1
d. 40 400 4


Ans: 20, 200, error for 3rd printf


Q8.

main()
{
 int (*functable[2])(char *format, ...) ={printf, scanf};
 int i = 100;

(*functable[0])("%d", i);

 (*functable[1])("%d", i);
 (*functable[1])("%d", i);
 (*functable[0])("%d", &i);

}


a. 100, Runtime error.

b. 100, Random number, Random number, Random number.
c. Compile error
d. 100, Random number



Q9.

main()
{
 int i, j, *p;
 i = 25;
 j = 100;
 p = &i; // Address of i is assigned to pointer p
 printf("%f", i/(*p) ); // i is divided by pointer p
}

a. Runtime error.

b. 1.00000
c. Compile error
d. 0.00000




Ans: c) Error becoz i/(*p) is 25/25 i.e 1 which is int & printed as a float,

So abnormal program termination,
runs if (float) i/(*p) -----> Type Casting

Q10.

main()
{
 int i, j;
 scanf("%d %d"+scanf("%d %d", &i, &j));
 printf("%d %d", i, j);
}

a. Runtime error.

b. 0, 0
c. Compile error
d. the first two values entered by the user



Ans: d) two values entered, 3rd will be null pointer assignment


Q11.


main()

{
 char *p = "hello world";
 p[0] = 'H';
 printf("%s", p);
}

a. Runtime error.

b. "Hello world
c. Compile error
d. "hello world




Ans: b) Hello world


Q12.

main()
{
 char * strA;
 char * strB = I am OK;
 memcpy( strA, strB, 6);
}

a. Runtime error.

b. I am OK
c. Compile error
d. I am O



Ans: c) I am OK is not in " "



Q13. How will you print % character?

a. printf("\%)
b. printf("\%)
c. printf("%%)
d. printf("\%%)


Ans: c) printf(" %% ");


Q14.

const int perplexed = 2;
#define perplexed 3

main()

{
 #ifdef perplexed
 #undef perplexed
 #define perplexed 4
 #endif
 printf("%d",perplexed);
}

a. 0

b. 2
c. 4
d. none of the above



Ans: c)


Q15.

struct Foo
{
 char *pName;
};

main()

{
 struct Foo *obj = malloc(sizeof(struct Foo));
 clrscr();
 strcpy(obj->pName,"Your Name");
 printf("%s", obj->pName);
}

a. Your Name

b. compile error
c. Name
d. Runtime error




Ans a)


Q16.

struct Foo
{
 char *pName;
 char *pAddress;
};

main()

{
 struct Foo *obj = malloc(sizeof(struct Foo));
clrscr();
 obj->pName = malloc(100);
 obj->pAddress = malloc(100);

strcpy(obj->pName,"Your Name");

 strcpy(obj->pAddress, "Your Address");

free(obj);

 printf("%s", obj->pName);
 printf("%s", obj->pAddress);
}

a. Your Name, Your Address

b. Your Address, Your Address
c. Your Name Your Name
d. None of the above






Ans: d) printd Nothing, as after free(obj), no memory is there containing

obj->pName & pbj->pAddress

Q17.

main()
{
 char *a = "Hello ";
 char *b = "World";
clrscr();
 printf("%s", strcat(a,b));
}

a. Hello

b. Hello World
c. HelloWorld
d. None of the above




Ans: b)


Q18.


main()

{
 char *a = "Hello ";
 char *b = "World";
 clrscr();
 printf("%s", strcpy(a,b));
}

a. "Hello

b. "Hello World
c. "HelloWorld
d. None of the above







Ans: d) World, copies World on a, overwrites Hello in a.


Q19.

void func1(int (*a)[10])
{
 printf("Ok it works");
}

void func2(int a[][10])

{
 printf("Will this work?");
}

main()
{
 int a[10][10];
 func1(a);
 func2(a);
}

a. Ok it works

b. Will this work?
c. Ok it worksWill this work?
d. None of the above







Ans: c)


Q20.

main()
{
 printf("%d, %d", sizeof('c'), sizeof(100));
}

a. 2, 2

b. 2, 100
c. 4, 100
d. 4, 4





Ans: a) 2, 2


Q21.

main()
{
 int i = 100;
 clrscr();
 printf("%d", sizeof(sizeof(i)));
}

a. 2

b. 100
c. 4
d. none of the above




Ans: a) 2


Q22.  


main()

{
 int c = 5;
 printf("%d", main||c);
}

a. 1

b. 5
c. 0
d. none of the above



Ans: a) 1, if we use main|c then error, illegal use of pointer



Q23.

main()
{
 char c;
 int i = 456;
 clrscr();
 c = i;
 printf("%d", c);
}

a. 456

b. -456
c. random number
d. none of the above







Ans: d) -56


Q24.

void main ()
{
 int x = 10;
 printf ("x = %d, y = %d", x,--x++);
}

a. 10, 10

b. 10, 9
c. 10, 11
d. none of the above






Ans: d) Lvalue required


Q25.

main()
{
 int i =10, j = 20;
 clrscr();
 printf("%d, %d, ", j-- , --i);
 printf("%d, %d ", j++ , ++i);
}

a. 20, 10, 20, 10

b. 20, 9, 20, 10
c. 20, 9, 19, 10
d. 19, 9, 20, 10







Ans: c)


Q26.


main()

{
 int x=5;
 clrscr();

for(;x==0;x--) {

 printf("x=%d
", x--);
 }
}

a. 4, 3, 2, 1, 0

b. 1, 2, 3, 4, 5
c. 0, 1, 2, 3, 4
d. none of the above





Ans: d) prints nothing, as condition x==0 is False


Q27

main()
{
 int x=5;

for(;x!=0;x--) {

 printf("x=%d
", x--);
 }
}

a. 5, 4, 3, 2,1

b. 4, 3, 2, 1, 0
c. 5, 3, 1
d. none of the above







Ans: d) Infinite loop as x is decremented twice, it never be 0

and loop is going on & on

Q28
main()
{
 int x=5;
 clrscr();

for(;x<= 0;x--)

{
 printf("x=%d ", x--);
 }
}
a. 5, 3, 1
b. 5, 2, 1,
c. 5, 3, 1, -1, 3
d. "3, -1, 1, 3, 5




Ans: prints nothing, as condition in loop is false.


Q29.

main()
{
 {
 unsigned int bit=256;
 printf("%d", bit);
 }
 {
 unsigned int bit=512;
 printf("%d", bit);
 }
}

a. 256, 256

b. 512, 512
c. 256, 512
d. Compile error



Ans: 256, 512, becoz these r different blocks, so declaration allowed


Q30.

main()
{
 int i;
 clrscr();
 for(i=0;i<5;i++)
 {
 printf("%d
", 1L << i);
 }
}
a. 5, 4, 3, 2, 1
b. 0, 1, 2, 3, 4
c. 0, 1, 2, 4, 8
d. 1, 2, 4, 8, 16




Ans: d) L does't make any diff.


Q31.

main()
{
 signed int bit=512, i=5;

for(;i;i--)

 {
 printf("%d
", bit = (bit >> (i - (i -1))));
 }
}

a. 512, 256, 128, 64, 32

b. 256, 128, 64, 32, 16
c. 128, 64, 32, 16, 8
d. 64, 32, 16, 8, 4



Ans: b)


Q32.

main()
{
 signed int bit=512, i=5;

for(;i;i--)

 {
 printf("%d
", bit >> (i - (i -1)));
 }
}

a. 512, 256, 0, 0, 0

b. 256, 256, 0, 0, 0
c. 512, 512, 512, 512, 512
d. 256, 256, 256, 256, 256




Ans: d) bit's value is not changed


Q33.

main()
{
 if (!(1&&0))
 {
 printf("OK I am done.");
 }
 else
 {
printf("OK I am gone.");
 }
}

a. OK I am done

b. OK I am gone
c. compile error
d. none of the above





Ans: a)


Q34

main()
{
 if ((1||0) && (0||1))
 {
 printf("OK I am done.");
 }
 else
 {
printf("OK I am gone.");
 }
}

a. OK I am done

b. OK I am gone
c. compile error
d. none of the above





Ans: a)


Q35

main()
{
 signed int bit=512, mBit;

{

mBit = ~bit;
bit = bit & ~bit ;

printf("%d %d", bit, mBit);

 }
}

a. 0, 0

b. 0, 513
c. 512, 0
d. 0, -513



Ans: d)

What is Multimedia ?

What is Multimedia ?


Multimedia is collection of text,image,audio,video,animation that are displayed to the user via some digital or mean.

Components of multimedia

*Text
*Image
*Audio
*Video
*Animation

Now some description about its component:-



Text:-the use of text , we can see everywhere in out life , to convey something we use text, to show something we use text and many more place we use it.
basically the term text includes alphabets,numeric,special character,etc.

a-z, A-Z, 0-9, !@#$%^&*, etc.


we can see the use text in textbooks , newspaper and many more places.font is also a part of text.but in font we include its property like bold , italic , underline , forecolor etc.


types of fonts:-


serif:-fonts which have tail at the end of each character , known as serif font.it is very useful for hardcopy thats why we see some textbooks containing serif fonts
example:-times new roman,bookman and so on


sans serif:-often used on webpages and does not have tails at the of each character
example:-arial,verdana and so on

Sunday, July 3, 2011

find out number vowel in a string

find out number vowel in a string

#include<stdio.h>
#include<conio.h>
void main()
{
char a[]="array";
int i,v=0,c=0;
for(i=0;a[i]!=NULL;i++)
{
if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u')
{
v++;
}
else
c++;
}
printf("there are %d vowel and %d consonant",v,c);
getch();
}

Calculate lenth of a String

Calculate lenth of a string without using Library Function

#include<stdio.h>
#include<conio.h>
void main()
{
char a[]="ram";
int i,c=0;
for(i=0;a[i]!=NULL;i++)
{
c++;
}
printf("lenth of the string is %d",c);
getch();
}

Sunday, June 26, 2011

Add two Numbers witout using + sign

Add two Numbers without using '+' sign

#include<stdio.h>
#include<conio.h>
void main()
{
int a=10,b=10,c;
c=a-(-b);
printf("total of a and b is %d",c);
getch();
}


Wednesday, June 8, 2011

Important shortcut keys often used in window

Shortcut Key       Desscription


Alt + F                    File menu options in current program.


Alt + E                    Edit options in current program


F1                          Universal Help in almost every Windows program.


Ctrl + A                  Select all text.


Ctrl + X                  Cut selected item.


Shift + Del               Cut selected item.


Ctrl + C                  Copy selected item.


Ctrl + Ins                Copy selected item


Ctrl + V                  Paste


Shift + Ins               Paste


Home                      Goes to beginning of current line.


Ctrl + Home            to beginning of document.


End                         Goes to end of current line.


Ctrl + End               Goes to end of document.


Shift + Home           Highlights from current position to beginning of line.


Shift + End              Highlights from current position to end of line.


Ctrl + Left arrow      Moves one word to the left at a time.


Ctrl + Right arrow    Moves one word to the right at a time.

Monday, May 2, 2011

Conditional operator in C

In C Programing there is only one ternary operator called conditional opertor

if there are more than two operends in a operator then it is called Ternary operator

syntx of ternary operator in C

var.=(exp?stat1. : stat2);

if expression is true then stat1 will be executed otherwise stat2 will be executed

example of conditional operator:-

int a,b,c;
a=1;
b=2;
c=a>b?a:b;        /*conditional operator*/

Now firstly it will check whether a is big or b is big. if condition true then 'a' will be assigned in 'c' variable otherwise 'b' will be assigned in 'c' variable

And 1 is not greater than 2 . its mean condition becomes false and so 'b' will be assigned in 'c' variable.


A programe to findout the max value among three given values

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d;
a=1;
b=2,c=3;
d=(a>b?(a>c?a:c):(b>c?b:c));
printf("%d",d);
getch();
}

output:-
3

Sunday, April 3, 2011

some cool defination related to computer

  • Applet
    A small Java application that is downloaded by an ActiveX or Java-enabled web browser. Once it has been downloaded, the applet will run on the user's computer. Common applets include financial calculators and web drawing programs.
  • Application
    Computer software that performs a task or set of tasks, such as word processing or drawing. Applications are also referred to as programs.
  • ASCII
    American Standard Code for Information Interchange, an encoding system for converting keyboard characters and instructions into the binary number code that the computer understands.
  • Bandwidth
    The capacity of a networked connection. Bandwidth determines how much data can be sent along the networked wires. Bandwidth is particularly important for Internet connections, since greater bandwidth also means faster downloads.
  • Binary code
    The most basic language a computer understands, it is composed of a series of 0s and 1s. The computer interprets the code to form numbers, letters, punctuation marks, and symbols.
  • Bit
    The smallest piece of computer information, either the number 0 or 1. In short ther are called binary digits.
  • Boot
    To start up a computer. Cold boot.restarting computer after having turned off the power. Warm boot.restarting computer without having turned off the power.
  • Browser
    Software used to navigate the Internet. Netscape Navigator and Microsoft Internet Explorer are today's most popular browsers for accessing the World Wide Web.
  • Bug
    A malfunction due to an error in the program or a defect in the equipment.
  • Byte
    Most computers use combinations of eight bits, called bytes, to represent one character of data or instructions. For example, the word .cat. has three characters, and it would be represented by three bytes.
  • Cache
    A small data-memory storage area that a computer can use to instantly re-access data instead of re-reading the data from the original source, such as a hard drive. Browsers use a cache to store web pages so that the user may view them again without reconnecting to the Web.
  • CAD-CAM
    Computer Aided Drawing-Computer Aided Manufacturing. The instructions stored in a computer that will be translated to very precise operating instructions to a robot, such as for assembling cars or laser-cutting signage.
  • CD-ROM
    Compact Disc Read-Only Memory. An optically read disc designed to hold information such as music, reference materials, or computer software. A single CD-ROM can hold around 640 megabytes of data, enough for several encyclopedias. Most software programs are now delivered on CD-ROMs.
  • CGI
    Common Gateway Interface. A programming standard that allows visitors to fill out form fields on a Web page and have that information interact with a database, possibly coming back to the user as another Web page. CGI may also refer to Computer-Generated Imaging, the process in which sophisticated computer programs create still and animated graphics, such as special effects for movies.
  • Chat
    Typing text into a message box on a screen to engage in dialog with one or more people via the Internet or other network.
  • Chip
    A tiny wafer of silicon containing miniature electric circuits that can store millions of bits of information.
  • Client
    A single user of a network application that is operated from a server. A client/server architecture allows many people to use the same data simultaneously. The program's main component (the data) resides on a centralized server, with smaller components (user interface) on each client.
  • Cookie
    A text file sent by a Web server that is stored on the hard drive of a computer and relays back to the Web server things about the user, his or her computer, and/or his or her computer activities.
  • CPU
    Central Processing Unit. The brain of the computer.
  • Cracker
    A person who .breaks in. to a computer through a network, without authorization and with mischievous or destructive intent.
  • Crash
    A hardware or software problem that causes information to be lost or the computer to malfunction. Sometimes a crash can cause permanent damage to a computer.
  • Cursor
    A moving position-indicator displayed on a computer monitor that shows a computer operator where the next action or operation will take place.
  • Cyberspace
    Slang for internet ie. An international conglomeration of interconnected computer networks. Begun in the late 1960s, it was developed in the 1970s to allow government and university researchers to share information. The Internet is not controlled by any single group or organization. Its original focus was research and communications, but it continues to expand, offering a wide array of resources for business and home users.

  • Database
    A collection of similar information stored in a file, such as a database of addresses. This information may be created and stored in a database management system (DBMS).

  • Debug
    Slang. To find and correct equipment defects or program malfunctions.

  • Default
    The pre-defined configuration of a system or an application. In most programs, the defaults can be changed to reflect personal preferences.

  • Desktop
    The main directory of the user interface. Desktops usually contain icons that represent links to the hard drive, a network (if there is one), and a trash or recycling can for files to be deleted. It can also display icons of frequently used applications, as requested by the user.

  • Desktop publishing
    The production of publication-quality documents using a personal computer in combination with text, graphics, and page layout programs.

  • Directory
    A repository where all files are kept on computer.

  • Disk
    Two distinct types. The names refer to the media inside the container:

    A hard disc stores vast amounts of data. It is usually inside the computer but can be a separate peripheral on the outside. Hard discs are made up of several rigid coated metal discs. Currently, hard discs can store 15 to 30 Gb (gigabytes)

    A floppy disc, 3.5" square, usually inserted into the computer and can store about 1.4 megabytes of data. The 3.5" square .floppies. have a very thin, flexible disc inside. There is also an intermediate-sized floppy disc, trademarked Zip discs, which can store 250 megabytes of data.

  • Disk drive
    The equipment that operates a hard or floppy disc.

  • Domain
    Represents an IP (Internet Protocol) address or set of IP addresses that comprise a domain. The domain name appears in URLs to identify web pages or in email addresses. For example, the email address for the First Lady is first.lady@whitehouse.gov, .whitehouse.gov. being the domain name. Each domain name ends with a suffix that indicates what .top level domain. it belongs to. These are: ..com. for commercial, ..gov. for government, ..org. for organization, ..edu. for educational institution, ..biz. for business, ..info. for information, ..tv. for television, ..ws. for website. Domain suffixes may also indicate the country in which the domain is registered. No two parties can ever hold the same domain name.

  • Domain name
    The name of a network or computer linked to the Internet. Domains are defined by a common IP address or set of similar IP (Internet Protocol) addresses.

  • Download
    The process of transferring information from a web site (or other remote location on a network) to the computer. It is possible to .download a file. or .view a download.

  • DOS
    Disk Operating System. An operating system designed for early IBM-compatible PCs.

  • Drop-down menu
    A menu window that opens vertically on-screen to display context-related options. Also called pop-up menu or pull-down menu.

  • DSL
    Digital Subscriber Line. A method of connecting to the Internet via a phone line. A DSL connection uses copper telephone lines but is able to relay data at much higher speeds than modems and does not interfere with telephone use.

  • DVD
    Digital Video Disc.Similar to a CD-ROM, it stores and plays both audio and video.

  • E-book
    An electronic (usually hand-held) reading device that allows a person to view digitally stored reading materials.

  • Email
    Electronic mail; messages, including memos or letters, sent electronically between networked computers that may be across the office or around the world.

  • Emoticon
    A text-based expression of emotion created from ASCII characters that mimics a facial expression when viewed with your head tilted to the left. Here are some examples:
    :-) Smiling
    :-( Frowning
    ;-) Winking
    :_( Crying

  • Encryption
    The process of transmitting scrambled data so that only authorized recipients can unscramble it. For instance, encryption is used to scramble credit card information when purchases are made over the Internet.

  • Ethernet
    A type of network.

  • Ethernet card
    A board inside a computer to which a network cable can be attached.

  • File
    A set of data that is stored in the computer.

  • Firewall
    A set of security programs that protect a computer from outside interference or access via the Internet.

  • Folder
    A structure for containing electronic files. In some operating systems, it is called a .directory.

  • Fonts
    Sets of typefaces (or characters) that come in different styles and sizes.

  • Freeware
    Software created by people who are willing to give it away for the satisfaction of sharing or knowing they helped to simplify other people's lives. It may be freestanding software, or it may add functionality to existing software.

  • FTP
    File Transfer Protocol. A format and set of rules for transferring files from a host to a remote computer.

    • Gigabyte (GB)
      1024 megabytes. Also called gig.
    • Glitch
      The cause of an unexpected malfunction.
    • Gopher
      An Internet search tool that allows users to access textual information through a series of menus, or if using FTP, through downloads.
    • GUI
      Graphical User Interface. A system that simplifies selecting computer commands by enabling the user to point to symbols or illustrations (called icons) on the computer screen with a mouse.
    • Groupware
      Software that allows networked individuals to form groups and collaborate on documents, programs, or databases.
    • Hacker
      A person with technical expertise who experiments with computer systems to determine how to develop additional features. Hackers are occasionally requested by system administrators to try and .break into. systems via a network to test security. The term hacker is sometimes incorrectly used interchangeably with cracker. A hacker is called a .white hat. and a cracker a .black hat.
    • Hard copy
      A paper printout of what you have prepared on the computer.
    • Hard drive
      Another name for the hard disc that stores information information in a computer.
    • Hardware
      The physical and mechanical components of a computer system, such as the electronic circuitry, chips, monitor, disks, disk drives, keyboard, modem, and printer.
    • Home page
      The main page of a Web site used to greet visitors, provide information about the site, or to direct the viewer to other pages on the site.
    • HTML
      Hypertext Markup Language. A standard of text markup conventions used for documents on the World Wide Web. Browsers interpret the codes to give the text structure and formatting (such as bold, blue, or italic).
    • HTTP
      Hypertext Transfer Protocol. A common system used to request and send HTML documents on the World Wide Web. It is the first portion of all URL addresses on the World Wide Web
    • HTTPS
      Hypertext Transfer Protocol Secure. Often used in intracompany internet sites. Passwords are required to gain access.
    • Hyperlink
      Text or an image that is connected by hypertext coding to a different location. By selecting the text or image with a mouse, the computer .jumps to. (or displays) the linked text.
    • Hypermedia
      Integrates audio, graphics, and/or video through links embedded in the main program.
    • Hypertext
      A system for organizing text through links, as opposed to a menu-driven hierarchy such as Gopher. Most Web pages include hypertext links to other pages at that site, or to other sites on the World Wide Web.
    • Icons
      Symbols or illustrations appearing on the computer screen that indicate program files or other computer functions.
    • Input
      Data that goes into a computer device.
    • Input device
      A device, such as a keyboard, stylus and tablet, mouse, puck, or microphone, that allows input of information (letters, numbers, sound, video) to a computer.
    • Instant messenging (IM)
      A chat application that allows two or more people to communicate over the Internet via real-time keyed-in messages.
    • Interface
      The interconnections that allow a device, a program, or a person to interact. Hardware interfaces are the cables that connect the device to its power source and to other devices. Software interfaces allow the program to communicate with other programs (such as the operating system), and user interfaces allow the user to communicate with the program (e.g., via mouse, menu commands, icons, voice commands, etc.).
    • Internet
      An international conglomeration of interconnected computer networks. Begun in the late 1960s, it was developed in the 1970s to allow government and university researchers to share information. The Internet is not controlled by any single group or organization. Its original focus was research and communications, but it continues to expand, offering a wide array of resources for business and home users.
    • IP (Internet Protocol) address
      An Internet Protocol address is a unique set of numbers used to locate another computer on a network. The format of an IP address is a 32-bit string of four numbers separated by periods. Each number can be from 0 to 255 (i.e., 1.154.10.266). Within a closed network IP addresses may be assigned at random, however, IP addresses of web servers must be registered to avoid duplicates.
    • Java
      An object-oriented programming language designed specifically for programs (particularly multimedia) to be used over the Internet. Java allows programmers to create small programs or applications (applets) to enhance Web sites.
    • Javascript/ECMA script
      A programming language used almost exclusively to manipulate content on a web page. Common Javascript functions include validating forms on a web page, creating dynamic page navigation menus, and image rollovers.
    • kilobyte (K or KB)
      Equal to 1,024 bytes.


    • Linux
      A UNIX.-like, open-source operating system developed primarily by Linus Torvalds. Linux is free and runs on many platforms, including both PCs and Macintoshes. Linux is an open-source operating system, meaning that the source code of the operating system is freely available to the public. Programmers may redistribute and modify the code, as long as they don't collect royalties on their work or deny access to their code. Since development is not restricted to a single corporation more programmers can debug and improve the source code faster.
    • Laptop and notebook
      Small, lightweight, portable battery-powered computers that can fit onto your lap. They each have a thin, flat, liquid crystal display screen.
    • Macro
      A script that operates a series of commands to perform a function. It is set up to automate repetitive tasks.
    • Mac OS
      An operating system with a graphical user interface, developed by Apple. for Macintosh. computers. Current System .X.1. (10) combines the traditional Mac interface with a strong underlying UNIX. operating system for increased performance and stability.
    • Megabyte (MB)
      Equal to 1,048,576 bytes, usually rounded off to one million bytes (also called a .meg.).
    • Memory
      Temporary storage for information, including applications and documents. The information must be stored to a permanent device, such as a hard disc or CD-ROM before the power is turned off, or the information will be lost. Computer memory is measured in terms of the amount of information it can store, commonly in megabytes or gigabytes.
    • Menu
      A context-related list of options that users can choose from.
    • Menu bar
      The horizontal strip across the top of an application's window. Each word on the strip has a context sensitive drop-down menu containing features and actions that are available for the application in use.
    • Merge
      To combine two or more files into a single file.
    • MHz
      An abbreviation for Megahertz, or one million hertz. One MHz represents one million clock cycles per second and is the measure of a computer microprocessor's speed. For example, a microprocessor that runs at 300 MHz executes 300 million cycles per second. Each instruction a computer receives takes a fixed number of clock cycles to carry out, therefore the more cycles a computer can execute per second, the faster its programs run. Megahertz is also a unit of measure for bandwidth.
    • Microprocessor
      A complete central processing unit (CPU) contained on a single silicon chip.
    • Minimize
      A term used in a GUI operating system that uses windows. It refers to reducing a window to an icon, or a label at the bottom of the screen, allowing another window to be viewed.
    • Modem
      A device that connects two computers together over a telephone or cable line by converting the computer's data into an audio signal. Modem is a contraction for the process it performs: modulate-demodulate.
    • Monitor
      A video display terminal.
    • Mouse
      A small hand-held device, similar to a trackball, used to control the position of the cursor on the video display; movements of the mouse on a desktop correspond to movements of the cursor on the screen.
    • MP3
      Compact audio and video file format. The small size of the files makes them easy to download and e-mail. Format used in portable playback devices.
    • Multimedia
      Software programs that combine text and graphics with sound, video, and animation. A multimedia PC contains the hardware to support these capabilities.
    • MS-DOS
      An early operating system developed by Microsoft Corporation (Microsoft Disc Operating System).
    • Network
      A system of interconnected computers.
    • Open source
      Computer programs whose original source code was revealed to the general public so that it could be developed openly. Software licensed as open source can be freely changed or adapted to new uses, meaning that the source code of the operating system is freely available to the public. Programmers may redistribute and modify the code, as long as they don't collect royalties on their work or deny access to their code. Since development is not restricted to a single corporation more programmers can debug and improve the source code faster.
    • Operating system
      A set of instructions that tell a computer on how to operate when it is turned on. It sets up a filing system to store files and tells the computer how to display information on a video display. Most PC operating systems are DOS (disc operated system) systems, meaning the instructions are stored on a disc (as opposed to being originally stored in the microprocessors of the computer). Other well-known operating systems include UNIX, Linux, Macintosh, and Windows.
    • Output
      Data that come out of a computer device. For example, information displayed on the monitor, sound from the speakers, and information printed to paper.


    • Palm
      A hand-held computer.
    • PC
      Personal computer. Generally refers to computers running Windows with a Pentium processor.
    • PC board
      Printed Circuit board. A board printed or etched with a circuit and processors. Power supplies, information storage devices, or changers are attached.
    • PDA
      Personal Digital Assistant. A hand-held computer that can store daily appointments, phone numbers, addresses, and other important information. Most PDAs link to a desktop or laptop computer to download or upload information.
    • PDF
      Portable Document Format. A format presented by Adobe Acrobat that allows documents to be shared over a variety of operating systems. Documents can contain words and pictures and be formatted to have electronic links to other parts of the document or to places on the web.
    • Pentium chip
      Intel's fifth generation of sophisticated high-speed microprocessors. Pentium means .the fifth element..
    • Peripheral
      Any external device attached to a computer to enhance operation. Examples include external hard drive, scanner, printer, speakers, keyboard, mouse, trackball, stylus and tablet, and joystick.
    • Personal computer (PC)
      A single-user computer containing a central processing unit (CPU) and one or more memory circuits.
    • Petabyte
      A measure of memory or storage capacity and is approximately a thousand terabytes.
    • Petaflop
      A theoretical measure of a computer's speed and can be expressed as a thousand-trillion floating-point operations per second.
    • Platform
      The operating system, such as UNIX., Macintosh., Windows., on which a computer is based.
    • Plug and play
      Computer hardware or peripherals that come set up with necessary software so that when attached to a computer, they are .recognized. by the computer and are ready to use.
    • Pop-up menu
      A menu window that opens vertically or horizontally on-screen to display context-related options. Also called drop-down menu or pull-down menu.
    • Power PC
      A competitor of the Pentium chip. It is a new generation of powerful sophisticated microprocessors produced from an Apple-IBM-Motorola alliance.
    • Printer
      A mechanical device for printing a computer's output on paper. There are three major types of printers: Dot matrix: creates individual letters, made up of a series of tiny ink dots, by punching a ribbon with the ends of tiny wires. (This type of printer is most often used in industrial settings, such as direct mail for labeling.)
      Ink jet: sprays tiny droplets of ink particles onto paper.
      Laser: uses a beam of light to reproduce the image of each page using a magnetic charge that attracts dry toner that is transferred to paper and sealed with heat.
    • Program
      A precise series of instructions written in a computer language that tells the computer what to do and how to do it. Programs are also called .software. or .applications.
    • Programming language
      A series of instructions written by a programmer according to a given set of rules or conventions (.syntax.). High-level programming languages are independent of the device on which the application (or program) will eventually run; low-level languages are specific to each program or platform. Programming language instructions are converted into programs in language specific to a particular machine or operating system (.machine language.) so that the computer can interpret and carry out the instructions. Some common programming languages are BASIC, C, C++, dBASE, FORTRAN, and Perl.
    • Puck
      An input device, like a mouse. It has a magnifying glass with crosshairs on the front of it that allows the operator to position it precisely when tracing a drawing for use with CAD-CAM software.
    • Pull-down menu
      A menu window that opens vertically on-screen to display context-related options. Also called drop-down menu or pop-up menu.
    • Push technology
      Internet tool that delivers specific information directly to a user's desktop, eliminating the need to surf for it. PointCast, which delivers news in user-defined categories, is a popular example of this technology.
    • QuickTime.
      Audio-visual software that allows movie-delivery via the Internet and e-mail. QuickTime mages are viewed on a monitor.
    • RAID
      Redundant Array of Inexpensive Disks. A method of spreading information across several disks set up to act as a unit, using two different techniques:
      Disk striping: storing a bit of information across several discs (instead of storing it all on one disc and hoping that the disc doesn't crash).
      Disk mirroring: simultaneously storing a copy of information on another disc so that the information can be recovered if the main disc crashes.
    • RAM
      Random Access Memory. One of two basic types of memory. Portions of programs are stored in RAM when the program is launched so that the program will run faster. Though a PC has a fixed amount of RAM, only portions of it will be accessed by the computer at any given time. Also called memory.
    • Right-click
      Using the right mouse button to open context-sensitive drop-down menus.
    • ROM
      Read-Only Memory. One of two basic types of memory. ROM contains only permanent information put there by the manufacturer. Information in ROM cannot be altered, nor can the memory be dynamically allocated by the computer or its operator.
    • Scanner
      An electronic device that uses light-sensing equipment to scan paper images such as text, photos, and illustrations and translate the images into signals that the computer can then store, modify, or distribute.
    • Search engine
      Software that makes it possible to look for and retrieve material on the Internet, particularly the Web. Some popular search engines are Alta Vista, Google, HotBot, Yahoo!, Web Crawler, and Lycos.
    • Server
      A computer that shares its resources and information with other computers, called clients, on a network.
    • Shareware
      Software created by people who are willing to sell it at low cost or no cost for the gratification of sharing. It may be freestanding software, or it may add functionality to existing software.
    • Software
      Computer programs; also called .applications.
    • Spider
      A process search engines use to investigate new pages on a web site and collect the information that needs to be put in their indices.
    • Spreadsheet
      Software that allows one to calculate numbers in a format that is similar to pages in a conventional ledger.
    • Storage
      Devices used to store massive amounts of information so that it can be readily retrieved. Devices include RAIDs, CD-ROMs, DVDs
    • Streaming
      Taking packets of information (sound or visual) from the Internet and storing it in temporary files to allow it to play in continuous flow.
    • Stylus and tablet
      A input device similar to a mouse. The stylus is pen shaped. It is used to .draw. on a tablet (like drawing on paper) and the tablet transfers the information to the computer. The tablet responds to pressure.the firmer the pressure used to draw, the thicker the line appears.
    • Surfing
      Exploring the Internet.
    • Surge protector
      A controller to protect the computer and make up for variances in voltage.


    • Telnet
      A way to communicate with a remote computer over a network.
    • Trackball
      Input device that controls the position of the cursor on the screen; the unit is mounted near the keyboard, and movement is controlled by moving a ball.
    • Terabytes (TB)
      A thousand gigabytes.
    • Teraflop
      A measure of a computer's speed. It can be expressed as a trillion floating-point operations per second.
    • Trojan Horse
      See virus.
    • UNIX.
      A very powerful operating system used as the basis of many high-end computer applications.
    • Upload
      The process of transferring information from a computer to a web site (or other remote location on a network). v. To transfer information from a computer to a web site (or other remote location on a network).
    • URL
      Uniform Resource Locator.
      1. The protocol for identifying a document on the Web.
      2. A Web address (e.g., www.tutorialspoint.com). A URL is unique to each user. See also domain.
    • UPS
      Universal Power Supply or Uninterruptible Power Supply. An electrical power supply that includes a battery to provide enough power to a computer during an outage to back-up data and properly shut down.
    • USB
      A multiple-socket USB connecter that allows several USB-compatible devices to be connected to a computer.
    • USENET
      A large unmoderated and unedited bulletin board on the Internet that offers thousands of forums, called newsgroups. These range from newsgroups exchanging information on scientific advances to celebrity fan clubs.
    • User friendly
      A program or device whose use is intuitive to people with a nontechnical background.
    • Video teleconferencing
      A remote "face-to-face chat," when two or more people using a webcam and an Internet telephone connection chat online. The webcam enables both live voice and video.
    • Virtual reality (VR)
      A technology that allows one to experience and interact with images in a simulated three-dimensional environment. For example, you could design a room in a house on your computer and actually feel that you are walking around in it even though it was never built. (The Holodeck in the science-fiction TV series Star Trek: Voyager would be the ultimate virtual reality.) Current technology requires the user to wear a special helmet, viewing goggles, gloves, and other equipment that transmits and receives information from the computer.
    • Virus
      An unauthorized piece of computer code attached to a computer program or portions of a computer system that secretly copies itself from one computer to another by shared discs and over telephone and cable lines. It can destroy information stored on the computer, and in extreme cases, can destroy operability. Computers can be protected from viruses if the operator utilizes good virus prevention software and keeps the virus definitions up to date. Most viruses are not programmed to spread themselves. They have to be sent to another computer by e-mail, sharing, or applications. The worm is an exception, because it is programmed to replicate itself by sending copies to other computers listed in the e-mail address book in the computer. There are many kinds of viruses, for example:
      Boot viruses place some of their code in the start-up disk sector to automatically execute when booting. Therefore, when an infected machine boots, the virus loads and runs.
      File viruses attached to program files (files with the extension ..exe.). When you run the infected program, the virus code executes.
      Macro viruses copy their macros to templates and/or other application document files.
      Trojan Horse is a malicious, security-breaking program that is disguised as something benign such as a screen saver or game.
      Worm launches an application that destroys information on your hard drive. It also sends a copy of the virus to everyone in the computer's e-mail address book.
    • WAV
      A sound format (pronounced .wave.) used to reproduce sounds on a computer.
    • Webcam
      A video camera/computer setup that takes live images and sends them to a Web browser.
    • Window
      A portion of a computer display used in a graphical interface that enables users to select commands by pointing to illustrations or symbols with a mouse. "Windows" is also the name Microsoft adopted for its popular operating system.
    • World Wide Web ("WWW" or "the Web")
      A network of servers on the Internet that use hypertext-linked databases and files. It was developed in 1989 by Tim Berners-Lee, a British computer scientist, and is now the primary platform of the Internet. The feature that distinguishes the Web from other Internet applications is its ability to display graphics in addition to text.
    • Word processor
      A computer system or program for setting, editing, revising, correcting, storing, and printing text.
    • Worm
      See virus.
    • WYSIWYG
      What You See Is What You Get. When using most word processors, page layout programs (See desktop publishing), and web page design programs, words and images will be displayed on the monitor as they will look on the printed page or web page.

     

    storage class in c

    A storage class defines the scope (visibility) and life time of variables and/or functions within a C Program.
    There are following storage classes which can be used in a C Program
    • auto
    • register
    • static
    • extern

    auto - Storage Class

    auto is the default storage class for all local variables.
    {
                int Count;
                auto int Month;
     }
    

    The example above defines two variables with the same storage class. auto can only be used within functions, i.e. local variables.

    register - Storage Class

    register is used to define local variables that should be stored in a register instead of RAM. This means that the variable has a maximum size equal to the register size (usually one word) and cant have the unary '&' operator applied to it (as it does not have a memory location).
    {
                register int  Miles;
     }
    

    Register should only be used for variables that require quick access - such as counters. It should also be noted that defining 'register' goes not mean that the variable will be stored in a register. It means that it MIGHT be stored in a register - depending on hardware and implimentation restrictions.

    static - Storage Class

    static is the default storage class for global variables. The two variables below (count and road) both have a static storage class.
    static int Count;
            int Road;
    
            {
                printf("%d\n", Road);
            }
    

    static variables can be 'seen' within all functions in this source file. At link time, the static variables defined here will not be seen by the object modules that are brought in.
    static can also be defined within a function. If this is done the variable is initalised at run time but is not reinitalized when the function is called. This inside a function static variable retains its value during vairous calls.
    void func(void);
       
       static count=10; /* Global variable - static is the default */
       
       main()
       {
         while (count--) 
         {
             func();
         }
       
       }
       
       void func( void )
       {
         static i = 5;
         i++;
         printf("i is %d and count is %d\n", i, count);
       }
       
       This will produce following result
       
       i is 6 and count is 9
       i is 7 and count is 8
       i is 8 and count is 7
       i is 9 and count is 6
       i is 10 and count is 5
       i is 11 and count is 4
       i is 12 and count is 3
       i is 13 and count is 2
       i is 14 and count is 1
       i is 15 and count is 0
    

    NOTE : Here keyword void means function does not return anything and it does not take any parameter. You can memoriese void as nothing. static variables are initialized to 0 automatically.
    Definition vs Declaration : Before proceeding, let us understand the difference between defintion and declaration of a variable or function. Definition means where a variable or function is defined in realityand actual memory is allocated for variable or function. Declaration means just giving a reference of a variable and function. Through declaration we assure to the complier that this variable or function has been defined somewhere else in the program and will be provided at the time of linking. In the above examples char *func(void) has been put at the top which is a declaration of this function where as this function has been defined below to main() function.
    There is one more very important use for 'static'. Consider this bit of code.
    char *func(void);
    
       main()
       {
          char *Text1;
          Text1 = func();
       }
    
       char *func(void)
       {
          char Text2[10]="martin";
          return(Text2);
       }
    
    Now, 'func' returns a pointer to the memory location where 'text2' starts BUT text2 has a storage class of 'auto' and will disappear when we exit the function and could be overwritten but something else. The answer is to specify
    static char Text[10]="martin";
    
    The storage assigned to 'text2' will remain reserved for the duration if the program.

    extern - Storage Class

    extern is used to give a reference of a global variable that is visible to ALL the program files. When you use 'extern' the variable cannot be initalized as all it does is point the variable name at a storage location that has been previously defined.
    When you have multiple files and you define a global variable or function which will be used in other files also, then extern will be used in another file to give reference of defined variable or function. Just for understanding extern is used to decalre a global variable or function in another files.
    File 1: main.c
    int count=5;
    
       main()
       {
         write_extern();
       }
    
    File 2: write.c
    void write_extern(void);
    
       extern int count;
    
       void write_extern(void)
       {
         printf("count is %i\n", count);
       }
    
    Here extern keyword is being used to declare count in another file.
    Now compile these two files as follows
    gcc main.c write.c -o write
    
    This fill produce write program which can be executed to produce result.
    Count in 'main.c' will have a value of 5. If main.c changes the value of count - write.c will see the new value

    to print all prime numbers till n

    #include <stdio.h>
    main()
    {
    int n,i=1,j,c;
    clrscr();
    printf("Enter Number Of Terms");
    scanf("%d",&n);
    printf("Prime Numbers Are Follwing");
    while(i<=n)
    {
    c=0;
    for(j=1;j<=i;j++)
    {
    if(i%j==0)
    c++;
    }
    if(c==2)
    printf("%d\t",i);
    i++;
    }
    getch();
    }

    Tuesday, March 22, 2011

    a simple file handling programe

    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int a,b;
    FILE *even,*odd;
    even=fopen("even.txt","w");
    odd=fopen("odd.txt","w");
    printf("enter the last term till you wanna see even and odd values");
    scanf("%d",&a);
    for(b=0;b<=a;b++)
    if(b%2==0)
    fprintf(even,"%d\n",b);
    else
    fprintf(odd,"%d\n",b);
    printf("operation has successfully completed");
    getch();
    }

    Saturday, March 19, 2011

    there are two ways to call a function
    1.call by value

    2.call by function


    in call by value variables are sent simply
    lets see the example
    int a=1,b=2;
    func(a,b);

    here func is function name and a and b are arguments and here values (a and b) are sent as simple agrument

    in call by reference address of a variable is sent while a calling a fuction and in function body we will use of pointer variable to access the value

    lets see the example

    int a=1,b=2;
    int *p,*ptr
    p=&a;
    ptr=&b;
    func(p,ptr);

    we can use following also for same task

    int a=1,b=2;
    func(&a,&b);

    here address of variable is sent thats why it is known as call by address

    now see the function body,will used in call by reference

    void func(int *x, int *y)
    {

    statement
    statement
    statement

    }

                                     programme for call by reference

    #include<stdio.h>
    #include<conio.h>
    void func(int *,int *); /*function prototype*/ 
    void main()
    {
    int a,b;
    a=1;
    b=2;
    func(&a,&b);
    getch();
    }
    void func(int *x, int *y);
    {
    int t;
    t=*y;
    *y=*x;
    *x=t;
    }

    Thursday, February 10, 2011

    addition of two matrix 3x3

    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int a[3][3],b[3][3],tot[3][3],i,j;
    clrscr();
    for(i=0;i<3;i++)
    {
     for(j=0;j<3;j++)
     {
     printf("enter element for first matrix");
     scanf("%d",&a[i][j]);
     }
    }
    for(i=0;i<3;i++)
    {
     for(j=0;j<3;j++)
     {
     printf("enter element for second matrix");
     scanf("%d",&b[i][j]);
     }
    }
    for(i=0;i<3;i++)
    {
     for(j=0;j<3;j++)
     {
     printf("%d\t",a[i][j]);
     }
    printf("\n");
    }
    for(i=0;i<3;i++)
    {
     for(j=0;j<3;j++)
     {
     printf("%d\t",b[i][j]);
     }
    printf("\n");
    }
    for(i=0;i<3;i++)
    {
     for(j=0;j<3;j++)
     {
     tot[i][j]=a[i][j]+b[i][j];
     printf("%d\t",tot[i][j]);
     }
    printf("\n");
    }
    getch();
    }

    programme to find out max value in array

    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int a[10],max,b;
    clrscr();
    for(b=0;b<10;b++)
    {
    printf("a[%d]=",b);
    scanf("%d",&a[b]);
    }
    max=a[b];
    for(b=0;b<10;b++)
    {
    if(a[b]>max)
    max=a[b];
    }
    printf("the max value is=%d",max);
    getch();
    }

    Programme to check that given number is armstrong or not

    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int n,d,s=0,t;
    clrscr();
    printf("enter value");
    scanf("%d",&n);
    t=n;
    while(n>0)
    {
    d=n%10;
    s=s+d*d*d;
    n=n/10;
    }
    if(t==s)
    printf("%d is armstrong number",t);
    else
    printf("%d isnt armstrong number",t);
    getch();
    }

    Programme to check that given number is palindrome or not

    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int n,d,r=0,t;
    printf("enter value");
    scanf("%d",&n);
    t=n;
    while(n>0)
    {
    d=n%10;
    r=r*10+d;
    n=n/10;
    }
    if(t==r)
    printf("%d is palindrome number",t);
    else
    printf("%d isnt palingdrome number",t);
    getch();
    }

    Wednesday, February 9, 2011

    to interchange two values

    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int a,b,c;
    printf("enter value for A and B=");
    scanf("%d%d",&a,&b);
    /*real logic starts from here*/
    c=b;
    b=a;
    a=c;
    printf("now a is=%d\nand b is=%d",a,b);
    getch();
    }

    output:
    enter value for A and B=10 12
    now a is=12
    and b is=10

    addition of two values

    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int a,b;/*int is data type AND a and b is two variables */
    printf("enter value for a and b=");
    scnaf("%d%d",&a,&b");
    printf("total of %d and %d  is=%d",a,b,a+b);
    getch();
    }

    first programme in c

    #include<stdio.h>/*header file*/
    #include<conio.h>/*header file*/
    void main()
    {
    printf("hello world!");/* printf will print hello world! as output*/
    getch();
    }
    सी का इतिहास
    सन १९६० मे कैम्ब्रिज विश्वविद्यालय ने एक कम्प्यूटर प्रोग्रामिंग भाषा का विकास किया जिसे उन्होने BASIC COMBINED PROGRAMMING LANGUAGE (BCPL) नाम दिया। इसे सामान्य बोल-चाल की भाषा मे बी (B) कहा गया। ’बी’ भाषा को सन १९७२ मे बेल्ल प्रयोगशाला में कम्प्यूटर वैज्ञानिक डेनिश रिची द्वारा संशोधित किया गया। ’सी’ प्रोग्रामिंग भाषा ’बी’ प्रोग्रामिंग भाषा का ही संशोधित रूप है। ’सी’ को यूनिक्स ऑपरेटिंग सिस्टम और डॉस ऑपरेटिंग सिस्टम दोनो मे प्रयोग किया जा सकता है, अन्तर मात्र कम्पाइलर का होता है। यूनिक्स ऑपरेटिंग सिस्टम ’सी’ मे लिखा गया ऑपरेटिंग सिस्स्टम है। यह विशेषत: ’सी’ को प्रयोग करने के लिये ही बनाया गया है अत: अधिकतर ’सी’ का प्रयोग यूनिक्स ऑपरेटिंग सिस्टम पर ही किया गया है।
    सी-भाषा मामूली अन्तर के साथ कई उपभाषाओं (dilects) के रूप में मिलती है। अमेरिकी राष्ट्रीय मानक संस्थान (अमेरिकन नेशनल स्टैण्डर्ड्स इंस्टीट्यूट) (ANSI) द्वारा विकसित ANSI C को अधिकतर मानक माना जाता है।

    ’सी’ प्रोग्रामिंग भाषा की विशेषताएं

    (१) इस प्रोग्रामिंग भाषा की सबसे महत्वपूर्ण विशेषता यह है कि इसमे उच्च स्तरीय प्रोग्रामिंग भाषा के समस्त गुण तो है ही, साथ ही इसमे निम्न स्तरीय भाषा के समस्त गुण पाए जाते है। उच्च स्तरीय भाषाएं FORTRAN, COBOL भी है लेकिन इसमे निम्न स्तरीय भाषा के गुण नही पाए जाते।
    (२) इस प्रोग्रामिंग भाषा मे तैयार किये गये प्रोग्राम की गति अपेक्षाकृत तीव्र होती है। यह ० से १५००० तक गिनने मे लगभग एक सेकण्ड का समय लगाती है जबकि बेसिक मे इस कार्य मे लगभग ५० सेकण्ड लगते है।
    (३) ’सी’ प्रोग्रामिंग भाषा मे प्रोग्राम मे प्रयोग करने हेतु अनेक functions परिभाषित होते है परन्तु इसमे एक अतिरिक्त सुविधा यह भी है कि प्रोग्रामर अपनी आवश्यकतानुसार नए functions भी परिभाषित कर सकता है।
    (४) इसमे मात्र ३२ की शब्दों का प्रयोग होता है इसके साथ ही इसमे अनेक अन्य सहायक प्रोग्राम भी होते है जिसकी सहायता से जटिल functions भी सफलतापूर्वक किए जा सकते है।
    (५) यह मुख्यत: गणित, विज्ञान एवं सिस्टम संबंधित कार्यो के काम आती है।
    (६) इस भाषा मे निर्देश देते समय lower case letters का ही प्रयोग किया जाता है।
    उपरोक्त विशेषताओ के कारण ही ’सी’ एक अत्यधिक लोकप्रिय कम्प्यूटर प्रोग्रामिंग भाषा है।

    Saturday, January 22, 2011

    C programme to print following:-
                  *
               *   *

             *   *   *
          *   *   *   *
    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int r,c,k;
    clrscr();

    printf("\n");
    for(r=0;r<5;r++)
    {
    for(c=0;c<5-r;c++)
    {
    printf(" ");
    }
    for(k=0;k<=r;k++)
    {
    printf("*");
    printf(" ");
    }
    printf("\n");
    }
    getch();
    }


    Friday, January 21, 2011

    basics of computer/computer fundamental

                                                INTRODUCTION


    Let us begin with the word ‘compute’. It means ‘to calculate’. We all are familiar with calculations in our day to day life. We apply mathematical operations like addition, subtraction, multiplication, etc. and many other formulae for calculations. Simpler calculations take less time. But complex calculations take much longer time. Another factor is accuracy in calculations. So man explored with the idea to develop a machine which can perform this type of arithmetic calculation faster and with full accuracy. This gave birth to a device or machine called ‘computer’.
    The computer we see today is quite different from the one made in the beginning. The number of applications of a computer has increased, the speed and accuracy of calculation has increased. You must appreciate the impact of computers in our day to day life. Reservation of tickets in Air Lines and Railways, payment of telephone and electricity bills, deposits and withdrawals of money from banks, business data processing, medical diagnosis, weather forecasting, etc. are some of the areas where computer has become extremely useful.
    However, there is one limitation of the computer. Human beings do calculations on their own. But computer is a dumb machine and it has to be given proper instructions to carry out its calculation. This is why we should know how a computer works.
                                    OBJECTIVES
    After going through this lesson you will be in a position to

    define a computer

    identify characteristics of computer

    know the origin and evolution of computer

    identify capability of computer in terms of speed and accuracy

    distinguish computer from human beings and calculator

    identify the role of computer

    appreciate the evolution of computer through five generations
                                 WHAT IS A COMPUTER?
    Computer is an electronic device. As mentioned in the introduction it can do arithmetic calculations faster. But as you will see later it does much more than that. It can be compared to a magic box, which serves different purpose to different people. For a common man computer is simply a calculator, which works automatic and quite fast. For a person who knows much about it, computer is a machine capable of solving problems and manipulating data. It accepts data, processes the data by doing some mathematical and logical operations and gives us the desired output.
    Therefore, we may define computer as a device that transforms data. Data can be anything like marks obtained by you in various subjects. It can also be name, age, sex, weight, height, etc. of all the students in your class or income, savings, investments, etc., of a country. Computer can be defined in terms of its functions. It can i) accept data ii) store data, iii) process data as desired, and iv) retrieve the stored data as and when required and v) print the result in desired format. You will know more about these functions as you go through the later lessons.




               CHARACTERISTICS OF COMPUTER
     
    Let us identify the major characteristics of computer. These can be discussed under the headings of speed, accuracy, diligence, versatility and memory.
    1 Speed
    As you know computer can work very fast. It takes only few seconds for calculations that we take hours to complete. Suppose you are asked to calculate the average monthly income of one thousand persons in your neighborhood. For this you have to add income from all sources for all persons on a day to day basis and find out the average for each one of them. How long will it take for you to do this? One day, two days or one week? Do you know your small computer can finish this work in few seconds? The weather forecasting that you see every day on TV is the results of compilation and analysis of huge amount of data on temperature, humidity, pressure, etc. of various places on computers. It takes few minutes for the computer to process this huge amount of data and give the result.
    You will be surprised to know that computer can perform millions (1,000,000) of instructions and even more per second. Therefore, we determine the speed of computer in terms of microsecond (10-6 part of a second) or nano-second (10-9 part of a second). From this you can imagine how fast your computer performs work.
    2 Accuracy
    Suppose some one calculates faster but commits a lot of errors in computing. Such result is useless. There is another aspect. Suppose you want to divide 15 by 7. You may work out up to 2 decimal places and say the dividend is 2.14. I may calculate up to 4 decimal places and say that the result is 2.1428. Some one else may go up to 9 decimal places and say the result is 2.142857143. Hence, in addition to speed, the computer should have accuracy or correctness in computing.
    The degree of accuracy of computer is very high and every calculation is performed with the same accuracy. The accuracy level is determined on the basis of design of computer. The errors in computer are due to human and inaccurate data.
    3 Diligence
    A computer is free from tiredness, lack of concentration, fatigue, etc. It can work for hours without creating any error. If millions of calculations are to be performed, a computer will perform every calculation with the same accuracy. Due to this capability it overpowers human being in routine type of work.
    4 Versatility
    It means the capacity to perform completely different type of work. You may use your computer to prepare payroll slips. Next moment you may use it for inventory management or to prepare electric bills.
    5 Power of Remembering
    Computer has the power of storing any amount of information or data. Any information can be stored and recalled as long as you require it, for any numbers of years. It depends entirely upon you how much data you want to store in a computer and when to lose or retrieve these data.
    6 No IQ
    Computer is a dumb machine and it cannot do any work without instruction from the user. It performs the instructions at tremendous speed and with accuracy. It is you to decide what you want to do and in what sequence. So a computer cannot take its own decision as you can.
    7 No Feeling
    It does not have feelings or emotion, taste, knowledge and experience. Thus it does not get tired even after long hours of work. It does not distinguish between users.
    8 Storage
    The Computer has an in-built memory where it can store a large amount of data. You can also store data in secondary storage devices such as floppies, which can be kept outside your computer and can be carried to other computers.
                                    Input Devices
     Input devices are necessary to convert our information or data in to a form which can be understood by the computer. A good input device should provide timely, accurate and useful data to the main memory of the computer for processing followings are the most useful input devices.
    1.
    Keyboard: - This is the standard input device attached to all computers. The layout of keyboard is just like the traditional typewriter of the type QWERTY. It also contains some extra command keys and function keys. It contains a total of 101 to 104 keys. A typical keyboard used in a computer is shown in Fig. 2.6. You have to press correct combination of keys to input data. The computer can recognise the electrical signals corresponding to the correct key combination and processing is done accordingly.
    2.
    Mouse: - Mouse is an input device shown in that is used with your personal computer. It rolls on a small ball and has two or three buttons on the top. When you roll the mouse across a flat surface the screen censors the mouse in the direction of mouse movement. The cursor moves very fast with mouse giving you more freedom to work in any direction. It is easier and faster to move through a mouse.
    3.
    Scanner: The keyboard can input only text through keys provided in it. If we want to input a picture the keyboard cannot do that. Scanner is an optical device that can input any graphical matter and display it back. The common optical scanner devices are Magnetic Ink Character Recognition (MICR), Optical Mark Reader (OMR) and Optical Character Reader (OCR).
    o
    Magnetic Ink Character Recognition (MICR): - This is widely used by banks to process large volumes of cheques and drafts. Cheques are put inside the MICR. As they enter the reading unit the cheques pass through the magnetic field which causes the read head to recognise the character of the cheques.
    o
    Optical Mark Reader (OMR): This technique is used when students have appeared in objective type tests and they had to mark their answer by darkening a square or circular space by pencil. These answer sheets are directly fed to a computer for grading where OMR is used.
    o
    Optical Character Recognition (OCR): - This technique unites the direct reading of any printed character. Suppose you have a set of hand written characters on a piece of paper. You put it inside the scanner of the computer. This pattern is compared with a site of patterns stored inside the computer. Whichever pattern is matched is called a character read. Patterns that cannot be identified are rejected. OCRs are expensive though better the MICR.

                                                                Output Devices
    1.
    Visual Display Unit: The most popular input/output device is the Visual Display Unit (VDU). It is also called the monitor. A Keyboard is used to input data and Monitor is used to display the input data and to receive massages from the computer. A monitor has its own box which is separated from the main computer system and is connected to the computer by cable. In some systems it is compact with the system unit. It can be color or monochrome.
    2.
    Terminals: It is a very popular interactive input-output unit. It can be divided into two types: hard copy terminals and soft copy terminals. A hard copy terminal provides a printout on paper whereas soft copy terminals provide visual copy on monitor. A terminal when connected to a CPU sends instructions directly to the computer. Terminals are also classified as dumb terminals or intelligent terminals depending upon the work situation.
    3.
    Printer: It is an important output device which can be used to get a printed copy of the processed text or result on paper. There are different types of printers that are designed for different types of applications. Depending on their speed and approach of printing, printers are classified as impact and non-impact printers. Impact printers use the familiar typewriter approach of hammering a typeface against the paper and inked ribbon. Dot-matrix printers are of this type. Non-impact printers do not hit or impact a ribbon to print. They use electro-static chemicals and ink-jet technologies. Laser printers and Ink-jet printers are of this type. This type of printers can produce color printing and elaborate graphics.