Vision and dreams are the blueprints of soul and achievements.
-Mohammed Ahmed F

Ethical Hacking Workshop @ HCL

Ethical Hacking Workshop @ HCL

Folks,

POST ON REQUEST by Salman 3rd Year:

Tomorrow HCL Velacherry branch is conducting a workshop on Ethical Hacking and the faculty will be from Anna university.

The cost of this workshop is Rs. 500/-.

Workshop timings is 10 am to 4pm. Total 6hrs, includes break.

Certificate is given.

The workshop will be useful because of HCL and Anna University's faculty has tied up for this.

If you are interested in this workshop then revert to Salman @ +91-8807387807 by tonight.

Miximum strength is 30 students. 21 filled. Only 9 seats left.

-Chief Administrative Officer.
Multiply without using * Operator

Multiply without using * Operator

Folks,

Here is another program from the series tricky code. Here I am going to show you how we can do Multiplication without using Multiply Operator *. You will rarely get this kind of programs.

Comment below to express your feeling and suggest me a new idea for more tricky code.

Logic of the code:

First you give a try to think the logic.

Code:

//C Program for Multiplication without Using Multiply Operator *

‪#‎include‬<iostream.h>

#include<conio.h>
void main()
{
int n, m, s=0;
clrscr();
cout <<"Enter the values";
cin>>n>>m;
while(m!=0)
{
s=s+n;
m--;
}
cout <<"Result = "<<s;
getch();
}


Here is the answer,

Let a and b be two variables then c=a*b. We take 9 as a and 8 as b then c=72.

In other word we are adding 9, 8 times or adding 9, 8 times, so simple logic.

This is what I converted into program.

Submit your own source code in the 'Contact Us' page or else herein the comment box of this post.

-Chief Administrative Officer.
Difference between C++ and Java

Difference between C++ and Java

Java is a true and complete object oriented language.
C++ is an extension of C with object oriented behavior. C++ is not a complete object oriented language as that of Java.

Java does not provide template classes.
C++ offers Template classes.

Java supports multiple inheritance using interface.
C++ achieves multiple inheritance by permitting classes to inherit from multiple classes.

Java does not provide global variables.
Global variables can be declared in C++.

Java does not support pointers.
C++ supports pointers.

In Java, destruction of objects is performed in finalize method.
In C++, destruction of objects is performed by destructor function.

Java doesn’t provide header files but imports packages.
C++ has header files.
Basics of C++

Basics of C++

Today we will see the basics of C++:

When we consider a C++ program it can be defined as a collection of objects that communicate via invoking each others methods.

Let us now briefly look into what do class, object, methods and instant variables mean.

Object - Objects have states and behaviors.

Example: A dog has states-color, name, breed as well as behaviors -wagging, barking, eating. An object is an instance of a class.

Class - A class can be defined as a template/ blue print that describe the behaviors/states that object of its type support.

Methods - A method is basically a behavior. A class can contain many methods.

It is in methods where the logics are written, data is manipulated and all the actions are executed.

Instant Variables - Each object has its unique set of instant variables. An object's state is created by the values assigned to these instant variables.

C++ Program Structure:

Let us look at a simple code that would print the words Hello World.

#include <iostream>

using namespace std;
// main() is where program execution begins.
int main()
{
   cout << "Hello World"; // prints Hello World
   return 0;
}


Let us look various parts of the above program:

The C++ language defines several headers, which contain information that is either necessary or useful to your program.

For this program, the header <iostream> is needed.

The line using namespace std; tells the compiler to use the std namespace. Namespaces are a relatively recent addition to C++.

The next line // main() is where program execution begins. is a single-line comment available in C++.

Single-line comments begin with // and stop at the end of the line.

The line int main() is the main function where program execution begins.

The next line cout << "This is my first C++ program."; causes the message "This is my first C++ program" to be displayed on the screen.

The next line return 0; terminates main() function and causes it to return the value 0 to the calling process.

Make sure that g++ is in your path and that you are running it in the directory containing file hello.cpp.

You can compile C/C++ programs using makefile.

Semicolons & Blocks in C++:

In C++, the semicolon is a statement terminator. That is, each individual statement must be ended with a semicolon. It indicates the end of one logical entity.

For example, following are three different statements:

x = y;

y = y+1;
add(x, y);


A block is a set of logically connected statements that are surrounded by opening and closing braces.

For example:
{

   cout << "Hello World"; // prints Hello World
   return 0;
}


C++ does not recognize the end of the line as a terminator. For this reason, it does not matter where on a line you put a statement.

For example:

x = y;

y = y+1;
add(x, y);


is the same as

x = y; y = y+1; add(x, y);

C++ Identifiers:

A C++ identifier is a name used to identify a variable, function, class, module, or any other user-defined item. An identifier starts with a letter A to Z or a to z or an underscore (_) followed by zero or more letters, underscores, and digits (0 to 9).

C++ does not allow punctuation characters such as @, $, and % within identifiers.

C++ is a case sensitive programming language. Thus, "Manpower" and "manpower" are two different identifiers in C++.

Here are some examples of acceptable identifiers:

mohd

zara
abc
move_name
a_123
myname50
_temp
j
a23b9
retVal


Whitespace in C++:

A line containing only whitespace, possibly with a comment, is known as a blank line, and C++ compiler totally ignores it.

Whitespace is the term used in C++ to describe blanks, tabs, newline characters and comments.

Whitespace separates one part of a statement from another and enables the compiler to identify where one element in a statement, such as int, ends and the next element begins.

Therefore, in the statement,

int age;

There must be at least one whitespace character (usually a space) between int and age for the compiler to be able to distinguish them. On the other hand, in the statement

fruit = apples + oranges;   // Get the total fruit

No whitespace characters are necessary between fruit and =, or between = and apples, although you are free to include some if you wish for readability purpose.
Reverse all words but not the string using pointer

Reverse all words but not the string using pointer

To write a C program to accept a string from the user and reverse all words but not the string using pointer.

String: sihT sI A dooG golB
Result: This Is A Good Blog


Solution:-

//C program for reverse all words but not the string using pointer

‪#‎include‬<stdio.h>
#include<conio.h>
int main()
{
char str[30];
char *p,*tmp;
printf("Enter any string: ");
gets(str);
for(p=str; *p!='\0'; p++)
{
if(*(p+1)==' ' || *(p+1)=='\0')
{
for(tmp=p; *tmp!=' ' && tmp>=str; tmp--)
printf("%c",*tmp);
}
printf(" ");
}
getch();
return 0;
}
Kindly note...

Kindly note...

Folks,

Android App is coming up for the Department of Computer Applications.

Department of Computer Applications will be the first department in the India to have an Android App for its department and also in our college as well! Wow!

Any suggestion / request to include something in the App?

Kindly comment on this post or send us a mail to 'interact2innovate@yahoo.com' or post your suggestions or comments on our fan page on Facebook - Click here to post

-Chief Administrative Officer.
Please don't buy this book

Please don't buy this book

Brief Description:

This is one of the self-development or personality development books available in the store. This has nothing extra or special in context to tell about, but the way it is presented and easy language makes it attractive. You can see the same essence which you see in 'You Can Win' or those of Dale Carnegie's collections. If you are someone who is lazy to read hundreds of pages, then this is for you.


Review:

When asked about the negative title given to the book, the author have beautifully told that this book has nothing  new and what others have told before is being re framed with catchy ingredients. Yes, I would say that there is nothing special or new in this book, but this is the book which I loved a lot after my all time favorite "How to Win Friends and Influence People " by Dale Carnegie.

When speaking in the marketing point of view I also learned that titles like this will definitely attract people to buy this. I too bought this just because of the title. So it not only taught me some basic development skills but also some marketing techniques.

It is always not possible to follow all the skills which a books says you to possess. But if a book can make you remember something whenever the occasions occur then I feel that it is the actual success of the book. There are few contexts which almost embedded into daily life which I would like to quote here,

"Don't try to expose yourself to someone who would have insulted you and is not bothered about whoever you are".

E.g., You may be a state topper in school or a renowned scientist, but in several situations may be when you go for a walk some unknown person may shout at you saying stupid for an accidental mistake. Here there is no use is explaining to him that you are a genius and not a stupid.

Actually the author has quoted this in the very first chapter by quoting an incident in Albert Einstein's life. Similarly few other quotes like combing the hair in a new way and travelling to office in a new direction can too have a some positive effects in your life and make you to love the day.

I would recommend you strongly to buy this book.


Where to buy:

SixthSense Publications,
29/ (7/3) ''E'' Block, Ist Floor,
Madley Road, T.Nagar,
Chennai - 600017
Ph: 65279654 / 24342771
Email : sixthsensepub@yahoo.com

Price : Rs.60/-.

The price is as per the 6th edition released in September, 2009.

-Chief Administrative Officer.
Introduction to Variables and Constants

Introduction to Variables and Constants

Variables and constants

What are variables?

Variables in C are memory locations that are given names and can be assigned values. We use variables to store data in memory for later use. There are 2 basic kinds of variables in C which are numeric and character.

Numeric variables

Numeric variables can either be integer values or they can be Real values. Integer values are whole numbers without a fraction part or decimal point in them. Real numbers can have a decimal point in them.

Character variables

Character variables are letters of the alphabet as well as all characters on the ASCII chart and even the numbers 0 - 9. Characters must always be put between single quotes. A number put between single quotes is not the same thing as a number without them.

What are constants?

The difference between variables and constants is that variables can change their value at any time but constants can never change their value. Constants can be useful for items such as Pi or the charge on an electron. Using constants can stop you from changing the value of an item by mistake.

Declaring variables

To declare a variable we first put the type of variable and then give the variable a name.

You can name a variable anything you like as long as it includes only letters, numbers or underscores and does not start with a number.

It is a good idea to keep your variable names less than 32 characters long to save time on typing them out and for compiler compatibility reasons. Variables must always be declared at the top before any other commands are used.

Now let's declare an integer variable called a and a character variable called b.


int main()

{
   int a;
   char b;
   return 0;
}


You can declare more than one variable at the same time in the following way:


int main()

{
   int a,b,c;
   return 0;
}

To declare a constant all you have to do it put the word const in front of a normal variable declaration and make assign a value to it.


int main()

{
   const float pi = 3.14;
   return 0;
}

Signed and unsigned variables

The difference between signed and unsigned variables is that signed variables can be either negative or positive but unsigned variables can only be positive. By using an unsigned variable you can increase the maximum positive range.

When you declare a variable in the normal way it is automatically a signed variable.

To declare an unsigned variable you just put the word unsigned before your variable declaration or signed for a signed variable although there is no reason to declare a variable as signed since they already are.


int main()

{
   unsigned int a;
   signed int b;
   return 0;
}

Using variables in calculations

To assign a value to a variable you use the equals sign.


int main()

{
   int a;
   char b;
   a = 3;
   b = 'H';
   return 0;
}

There are a few different operators that can be used when performing calculations which are listed in the following table:

Operator Operation


+ Addition

- Subtraction
* Multiplication
/ Division
% Modulus (Remainder of integer division)

To perform a calculation you need to have a variable to put the answer into. You can also use both variables and normal numbers in calculations.


int main()

{
   int a,b;
   a = 5;
   b = a + 3;
   a = a - 3;
   return 0;
}

Reading and printing variables

You can read a variable from the keyboard with the scanf command and print a variable with the printf command.


#include<stdio.h>

int main()
{
   int a;
   scanf("%d",&a);
   a = a * 2;
   printf("The answer is %d",a);
   return 0;
}

The %d is for reading or printing integer values and there are others as shown in the following table:


%d or %i int

%c char
%f float
%lf double
%s string

-Chief Administrative Officer.
Introduction to C++

Introduction to C++

What is C and why learn it?

C was developed in the early 1970s by Dennis Ritchie at Bell Laboratories. C was originally designed for writing system software but today a variety of software programs are written in C.

C can be used on many different types of computers but is mostly used with the UNIX operating system.

It is a good idea to learn C because it has been around for a long time which means there is a lot of information available on it.

Quite a few other programming languages such as C++ and Java are also based on C which means you will be able to learn them more easily in the future.

Your first program:

The first thing you must do i download the Turbo C++ and now type the following lines of code and then I will explain it. Make sure that you type it exactly as I have or else you will have problems.

Also don't be scared if you think it is too complicated because it is all very easy once you understand it.

#include<stdio.h>

int main()
{
   printf("Hello World\n");
   return 0;
}


#include<stdio.h>

This includes a file called stdio.h which lets us use certain commands. stdio is short for Standard Input/Output which means it has commands for input like reading from the keyboard and output like printing things on the screen.

int main()

int is what is called the return value which will be explained in a while. main is the name of the point where the program starts and the brackets are there for a reason that you will learn in the future but they have to be there.

{}

The 2 curly brackets are used to group all the commands together so it is known that the commands belong to main. These curly brackets are used very often in C to group things together.

printf("Hello World\n");

This is the printf command and it prints text on the screen. The data that is to be printed is put inside brackets.

You will also notice that the words are inside inverted commas because they are what is called a string.

Each letter is called a character and a series of characters that is grouped together is called a string. Strings must always be put between inverted commas.

The \n is called an escape sequence and represents a newline character and is used because when you press ENTER it doesn't insert a new line character but instead takes you onto the next line in the text editor.

You have to put a semi-colon after every command to show that it is the end of the command.

Table of commonly used escape sequences:

\a- Audible signal

\b- Backspace
\t - Tab
\n - Newline
\v- Vertical tab
\f - New page / Clear screen
\r -Carriage return


return 0;

The int in int main() is short for integer which is another word for number. We need to use the return command to return the value 0 to the operating system to tell it that there were no errors while the program was running.

Notice that it is a command so it also has to have a semi-colon after it.

Save the text file as hello.c and now rum the program.

Indentation:

You will see that the printf and return commands have been indented or moved away from the left side. This is used to make the code more readable.

It seems like a stupid thing to do because it just wastes time but when you start writing longer, more complex programs, you will understand why indentation is needed.

Using comments:

Comments are a way of explaining what a program does. They are put after // or between /* */.

Comments are ignored by the compiler and are used by you and other people to understand your code.

You should always put a comment at the top of a program that tells you what the program does because one day if you come back and look at a program you might not be able to understand what it does but the comment will tell you.

You can also use comments in between your code to explain a piece of code that is very complex.

Here is an example of how to comment the Hello World program:

/* Author: Your name

   Date: yyyy/mm/dd
   Description:
   Writes the words "Hello World" on the screen */
#include<stdio.h>
int main()
{
   printf("Hello World\n"); //prints "Hello World"
   return 0;
}




INTRODUCTION TO C++:

Hello World Program:

Our first C++ program will print the message "Hello World" on the screen. Open a new project or console and start by typing the following line:

#include<iostream>

The above line includes the header file called iostream which will allow us to use the command to print words on the screen. Next you must type:

using namespace std;

This will let us use certain commands without having to type out their full name. Now we will type the main function.

int main()

{
}


The main function is where a program always starts. Every program must have a main function. The word int in front of main is to say what the return value is.

The curly brackets belong to the main function and show where it begins and where it ends. Now we will type the command that prints "Hello World" on the screen between the curly brackets.

cout << "Hello World\n";

The cout command is used to print things on the screen. The << means that the text must be output. The words that you want printed must be surrounded by quotes.

The \n means that the cursor must go the beginning of the next line. Lastly we must return 0 to the operating system to tell it that there were no errors while running the program.

return 0;

The full program should look like this:

#include<iostream>

using namespace std;
int main()
{
   cout << "Hello World\n";
   return 0;
}


Save the file as hello.cpp. You now need to compile the program. You need to open a command prompt and type the command name of your C++ compiler and the name of the C++ file you have just created.

Here is an example of how to do it with Turbo C++:

hello.cpp

If you are given error messages then you have made mistakes which means you should go through this post again and fix them.

If you don't get any errors then you should end up with an executable file which in my case is called hello.exe

Enter hello to run the program and you should see "Hello World" printed on the screen.

Congratulations! You have just made your first C++ program.

-Mohammed Ahmed F, Chief Administrative Officer.