Saturday, 16 November 2013


The Heart is nt a basket 4 keeping tension,stres,worries and sadness, its a golden box 4 keeping roses of happiness,joy,hope and high self-esteem. Let ur heart b happy always, accept the past 4 what it was, acknowlege the present 4 what it is. Anticipate the future 4 what it can become. Keep hope alive.Always Desire and Aspire 2 Inspire b4 u Expire. When u take life as drama it gives u trauma hence face it wid merisma and charisma n u'l b out of stigma n dilema.
Ua attitude is ua altitude.Remember,its when we give up that we replace fame with shame n gain with pain,bt always never give up!!

Monday, 11 November 2013

Answers to basic programming.
 
#include <stdio.h>
int main()
{
      float a, b, c;
      printf("Enter three numbers: ");
      scanf("%f %f %f", &a, &b, &c);
      if(a>=b && a>=c)
         printf("Largest number = %f", a);
      if(b>=a && b>=c)
         printf("Largest number = %f", b);
      if(c>=a && c>=b)
         printf("Largest number = %f", c);
      return 0;
}


number 2
#include <stdio.h>
int main()
{
    char a[4];
    int b=0;
    char c;
printf("Enter the four digit number \n");
scanf("%s",&a);

for (b=0;b<=3;b++)
{
    c = a[b];
        printf("%c, ",c);
}
return 0;
}
number 3
#include <stdio.h>
int main()
{
    int n; /*is the number of times we are looping*/
    int b; /* b is the loop counter.*/
    int c; /* c is the number we are entering*/
printf("Enter n  \n");
scanf("%d",&n);

for (b=0;b<=(n-1);b++)
{
    printf("Enter a number  \n");
    scanf("%d",&c);

    if (c<0)
    {
        break;
    }
}
return 0;
}
number 4
#include<stdio.h>
int main()
{
    int r;/*number of rows*/
    int c;/*number of columns */
    int d=0;/*number of stars to print*/

    for (c=0;c<=5;c++)/*loop*/
    {

        for (r=0;r<=d;r++)/*loop*/
        {
        printf("*");
        }
        d++;/*increment d from one star to the next*/
        printf("\n");/*next line*/

    }
    /* second part */
    d=5;
    for (c=5;c>=0;c--)/*loop*/
    {

        for (r=0;r<=d;r++)/*loop*/
        {
        printf("*");/*the stars to be printed*/
        }
        d--;/*decrease no of rows.*/
        printf("\n");/*next line*/
    }
    return 0;
    }
number5
#include <stdio.h>
#include <math.h>

void main()
{
    int p;
    int x;
    int y;
    int s;
    float total;
    printf("enter x");
    scanf("%d",&x);
    printf("enter y");
    scanf("%d",&y);
    p=x*y;
    s=x+y;
    total = s*s + p *(s-x) * (p+y);
    printf("Total is: %f",total);
}
number 6
#include <math.h>
#include <stdio.h>
int main()
{
    int x,x1;
    int a,b,c;
    printf("enter a b and c");
    scanf("%d %d %d",&a,&b,&c);
    /*if a and b are zero=>no solution*/
    /*if a is zero=>one root(-c/b)*/
    /*if b*b-4ac is negative=>no roots*/
    /*otherwise=> two roots*/
    x= (-b - sqrt((b*b)-(4*a*c)))/(2*a);
    x1 =( -b+ sqrt((b*b)-(4*a*c)))/(2*a);

    printf("Root one: %d and root two is: %d",x,x1);
    return 0;
}

Thursday, 17 October 2013

"Simple thing becomes complicated when you expect too much.#heartbreak
"Every single time your about to give up, hold on. Hold on because you didn't come this far to give up and walk away. Hold on because you know your stronger. hold on because you owe yourself that much."