Posts

Showing posts from 2010

A Pet Dog (Poem)

A Pet Dog

Furious barks play the host
To welcome guest at the door
Frightened guest shrinks
The dog beckons his poor master

He armours his guest
And let him in
With assurance for no harm
And command his pet to behave

MTV Roadies 8 (2010), Chandigarh Auditions. Went With Bro For His Auditions. Photos And Experience

Image
(click images for full size)

My bro Keshav turned 18 this year, and one of the first things he wanted to was participate in MTV Roadies. Glad MTV chose in-person group discussions and interviews over online forms.

We decided to be one of the first ones to be interviewed. For Season 8, they were coming to Chandigarh on Nov 19, 2010.

A Beautiful Thought That Can Put My Mind At Ease

On our last day our GTO told “If you are not recommended please understand that this is not your field”. (link) Regarding my dream to serve in the Military as an Officer and after my three attempts at the prestigious SSB Interviews, when I discovered my love for computers.

100hitz.com- Good Enough To Do Away With The iPod (Review Of Internet Radio Station)

While trying the Internet Radio (bundled with FM Radio app) on my Nokia mobile, I tried 100hitz.com Hip-Hop and I love the service.

It features hit songs and most of them are very enjoyable, together with details of the singer and album. And you can always buy the songs you find extraordinary from their playlist. And the number of ads is also minimum.

Tagging Tweeps- No More Local Lists, Know Who’s Actually The Funniest or Geekiest or Conversationalist

I see too many separate lists, possibly all good, tagging funny, conversationalists, and even maals (babes) on Twitter. It’s all about fun, but this technique is like the local maxima we read about in Artificial Intelligence books.

In my humble opinion, the next level for Twitter could be to allow signed-in users to thumbs up the users they’ve followed for a certain amount of time (say a week, to add credibility to the votes) to thumbs-up certain characteristics.

Modify the above program to display the two right-most digits of the integral part of the number

Image
//E Balagurusamy, Programming in ANSI C,4E
//Exercise 3.3, p81
//Note:
//. comments with //scaff indicate scaffolding code to help during development of code
//. can be safely commented out/removed (in production code)
//HOW?
//1. extract integral part by explicit type casting to int
//2. use modulus (%) operater once to get the right-most portion
//3. repeat step 2 to get the next left digit
#include <stdio.h>
#include <conio.h>
int main(void)
{
    float number=0.0;

Given the values of the variables x, y and z, write a program to rotate their values such that x has the value of y, y has the value of z, and z has the value of x

Image
//E Balagurusamy, Programming in ANSI C,4E
//Exercise 3.1, p81
//Note:
//. comments with //scaff indicate scaffolding code to help during development of code
//. can be safely commented out/removed (in production code)
//HOW?
//We'll take one temp variable and store any specific variable in it
//i.e that variable can then be written over.
//Thus, cycling over till we reach the end, where temp replaces the next one.
#include <stdio.h>
#include <conio.h>
int main(void)
{
    char x='x', y='y', z='z';
    char temp='0';

WAP to illustrate the use of symbolic constants in a real-life application

Image
//E Balagurusamy, Programming in ANSI C,4E
//Exercise 2.10, p51
//Note:
//. comments with //scaff indicate scaffolding code to help during development of code
//. can be safely commented out/removed (in production code)
#define PI 3.14159265
#include <stdio.h>
#include <conio.h>
int main(void)
{
    float radius=0.0, perimeter=0.0, area=0.0;
    printf("\nEnter the radius : ");

WAP to read two floating point numbers using a scanf statement, assign their sum to an integer variable and then output the values of all the three variables

Image
//E Balagurusamy, Programming in ANSI C,4E
//Exercise 2.8, p51
//Note:
//. comments with //scaff indicate scaffolding code to help during development of code
//. can be safely commented out/removed (in production code)
#include <stdio.h>
#include <conio.h>
int main (void)
{
    float real_first=0.0, real_second=0.0;
    int sum=0;

WAP to generate ASCII value table for English alphabet, without prior knowledge of any ASCII value

Image
//A program to list the ASCII codes for
//alphabets A-Z and a-z without any prior idea
//of ASCII code
//ASCII:
//American Standard Code for Information Interchange.
//It is a character-encoding scheme based on the ordering of
//the English alphabet. ASCII codes represent text in computers,
//communications equipment, and other devices that use text.
//- by Wikipedia
#include <stdio.h>
int main(void)
{
    int i=0, j=0; //for loops

My Kid Brother Of Five Makes A Sketch Of Me :)

Image
Image by gopal1035 "There's one perfect child and every parent has it"

Vivek made this for me and even signed it on my request, with two parallel lines.

Cute.

WAP to do the following: (E Balagurusamy, Programming In ANSI C, Problem 2-7)

Image
Declare x and y as integer variables and z as a short integer variable. Assign two 6 digit numbers to x and y. Assign the sum of x and y to z. Output the values of x, y and z. Comment on the output

//E Balagurusamy, Programming In ANSI C,4E
//Exercise 2.7, page 51
//Note:
//. comments with //scaff indicate code to help during development of code
//. can be safely commented out/removed
#include <stdio.h>
#include <conio.h>
#include <math.h>

When Will I Get My XBOX?? My Kid Brother Of Five Is So Into Video Games

Image
(click for larger image)

Feminists

Image
During tech-fest in my campus… Isn’t this concept funny?

WAP to count and print the number of negative and positive numbers in a given set of numbers. Test your program with a suitable set of numbers. Use scanf() to read the numbers. Reading should be terminated when the value 0 is encountered

//E Balagurusamy, Programming In ANSI C,4E
//Exercise 2.6, page 51
#include <stdio.h>
#include <conio.h>
int main(void)
{
int n=0, positive=0, negative=0;

WAP to input price of one kg of rice and one kg of sugar print them in an appropriate manner (like 2 decimal places for money)

//E Balagurusamy, Programming In ANSI C,4E
//Exercise 2.5, page 51
#include <stdio.h>
#include <conio.h>
int main(void)
{
float price_rice=0.0, price_sugar=0.0;
//input prices
printf("Enter price of 1 kg rice  : ");
scanf("%f",&price_rice);

WAP that requests two float type numbers from the user and then divides the first number by the second and displays the result along with the numbers

//E Balagurusamy, Programming In ANSI C,4E
//Exercise 2.4, page 51
#include <stdio.h>
#include <conio.h>
int main(void)
{float input_first=0.0, input_second=0.0, div=0.0;

WAP that prints the even numbers from 1 to 100

//E Balagurusamy, Programming In ANSI C,4E
//Exercise 2.3, page 51
#include <stdio.h>
#include <conio.h>
int main(void)
{int i=0;
printf("\n\n");
printf("===Even Numbers From 1 To 100===\n\n");
for (i=1; i<=100; i++)
    {if ((i%2)==0)
        {printf("%d\t",i);
        }
    }
//"There are more ways to solve this simple problem,
//like beginning the loop from 2 and incrementing by +2
//printing index at each iteration...
//Personally, I like this version better"
getch();
return 0;
}

WAP to read the price of an item in decimal form (like 15.95) and print the output in paise (like 1595 paise)

//E Balagurusamy, Programming In ANSI C,4E
//Exercise 2.2, page 51
#include <stdio.h>
#include <conio.h>
#include <math.h>
int main(void)
{float amount_input=0.0;
int amount_in_paise=0;

WAP to determine and print the sum of the following harmonic series for a given value of n: 1 + (1/2) + (1/3) + (1/4) + ... + (1/n)

The value of n should be given interactively through the terminal.

//E Balagurusamy, Programming In ANSI C,4E
//Exercise 2.1, page 51
#include <stdio.h>
#include <conio.h>
int main(void)
{int n=0, i=0;

WAP to implement DDA Digital Differential Analyzer

Image
//DDA Line Rasterization Algorithm

//Practical assignment under MCA (TYC)- Sem IV
//Guru Nanak Dev University, Amritsar Campus

#include <iostream.h>
#include <math.h>
#include <conio.h>

int main(void)
{
cout<<endl<<endl;

int x1, y1; //starting point
int x2, y2; //ending point

A Simple Mistype Of Equal Sign As Hyphen Cost Me About 20 Minutes

Image

Birthday Of Lal Mata, Lal Mata Mandir, Rani Ka Bagh, Amritsar (21 Feb 2010) Celebrated By Devotees In Large Numbers (photo tour)

Image
(click image for larger)

GNDU’s Annual Cultural Festival- Jashan 2010, Some Photos

Image
(click image for larger)

Today's Mighty Oak Is Just Yesterday's Chestnut That Held It's Ground

Image
Image by gopal1035 Sometimes you find the most inspiring thoughts at the least likely places. This one occurred to me in my lawn, somewhat similar to king Bruce and the spider.

Here is a small sapling that has its sunlight severely restricted by bigger plants and trees.

Morning Walk With Dogs

Image
Image by gopal1035

Friends Don't Chain Friends :)

Image
Image by gopal1035 This is my lovely dog Noddy

There's Only One Perfect Child In The World And Every Mother Has It

Image
I miss my late dog Noddy, and no other dog can take his place...

Yes maybe a new black Lab raised from pup might be acceptable- but still Noddy is immortal.

See you on the Rainbow Bridge buddy!