Search This Blog

Simplicity is the ultimate sophistication.” — Leonardo da Vinci
Contact me: sreramk360@gmail.com

Friday, 17 April 2015

The legend of the unbreakable coin




The legend of the unbreakable coin

-K Sreram

Episode 1

"Time can be bent in the most mysterious possible ways"–An old man


Part 1 (part 2 is still pending to be written)

“I send you out to buy tomatoes for fifty two rupees and you come back to tell me that you were robbed? Which robber robs fifty two rupees?” asked Hema to her younger brother Roshan who had just returned home after losing a sum of fifty two rupees to a stranger. He said “I told you! He demanded for the money. He first asked me for some food, claiming to not have eaten for three days. I said I had none, but only had the fifty two rupees which I needed for buying tomatoes”
Hema said “why would you need to tell him how much you had? Of course! Now it makes sense. It’s like approaching a stranger voluntarily and telling him ‘Mr. Robber. I have some money with me. It’s not much, but you may rob me’”.

Friday, 3 April 2015

program to evaluate infix expressions



Program to evaluate infix expressions
 

/*
* Program to convert an infix arithmetic expression to
* postfix and to thereby evaluate the result.
*/

Thursday, 2 April 2015

Example program for queue



Example program for queue


Program:

/*
* This program is written to obtain the job application form and to later verify the forms
* using queue implementation.
*/

Wednesday, 1 April 2015

CS6212 lab manual programs


- By

Uploaded on:

CS6212 lab manual programs (complete solutions - C programs).

The following programs are written for the subject CS6212 (only the first ten out of twelve are given here). These programs or based on BE- CSE semester 2 lab syllabus. I am a student doing my second semester BE CSE currently while writing down these record programs. So please excuse me for any mistakes that might have crept in the programs (but I have made sure that the following programs are error free and warning free and also works as expected).  

Monday, 30 March 2015

Example program that imitiates function stack




An example program that imitates function stack

Program:

/*
 an example program that imitates the "function stack" concept.
 This program is already available as the second program in these record
 program series, but here recession is imitated with a fake function stack!

*/

Friday, 27 March 2015

employee record program



Program to manipulate and store employee records
 

/*
* problem 3
* employee record program
*/
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#define NILL 0
#define Set_NULL(employeeRec) (*((unsigned long long int*)&employeeRec) = NILL)
#define Check_If_Null(employeeRec) ( *((unsigned long long int*)&employeeRec) == NILL )
struct EMPLOYEE;
typedef struct EMPLOYEE Employee;

struct EMPLOYEE
{
    char name[50];
    float Salary;
    char designation[100];
    unsigned int empNo;
};

Employee getRecord()
{
    Employee emp;
    printf("\nenter the employee details: ");
    printf("\nenter name: "); fflush(stdin);
    gets(emp.name); fflush(stdin);
    printf("\nenter the salary of the employee: ");
    scanf("%f", &emp.Salary); fflush(stdin);
    printf("\nenter the designation of the employee: ");
    scanf("%s", emp.designation); fflush(stdin);
    printf("\nenter the employee number: ");
    scanf("%d", &emp.empNo);
    return emp;
}

An example program for control statements and conditional statements



An example program for control statements and conditional statements


/*
* An example program for control statements and conditional statements
* problem: write a program to solve the following problem:
*    statement: Let there be an integer array A with n elements. Lets say that
*    we choose m numbers from the n numbers (a number can be chosen twice) and add them
*    to obtain the value x. So algorithmically determine the number of combinations
*    possible to bring about the sum x. Note: the values can be repeated.
**** By K Sreram
*/

Featured post

Why increasing complexity is not good?

“ Simplicity is the ultimate sophistication.” — Leonardo da Vinci Why is complicating things wrong ? - K Sr...