Bug Fix

Moving on to some programming problems. Learned if-else, loops, arrays and so on but couldn’t find bugs in a code. If any one could help me please comment.

Problem: Have to make a reverse array and print it but not making two different arrays.

input: 1 2 3 4 5 6 7 8 9 10

output: 10 9 8 7 6 5 4 3 2 1

Solve what I made:

#include <stdio.h>

int main()
{
int ara[10];

int i,j, temp;

for(i=0;i<10;i++){
scanf(“%d”,& ara[i]);
}

for(i=0, j=9; i<10; i++, j–){

temp = ara[i];
ara[i] = ara[j];

ara[j] = temp;

}
for(i=0;i<10;i++){
ara[i]=ara[j];
}

for(i = 0;i<10;i++){
printf(“%d\n”, ara[i]);
}

return 0;
}

Advertisements

beginners problem

I found a small problem solving it took me hours as I am a beginner. Thought I could share it with you.

its basically a problem of C Programming. the problem was to keep the outcome same but not using the multiplication(*) function. So without further ado lets write the codes..

#include <stdio.h>

int main()

{

    int n.m;

    for(n=1;n<=20;n++){

        for(m=1;m<=10;m++){

            printf(“%d x %d = %d”, n, m, n*m);

        }

    }

    return 0;

}

whatever the outcome is you have to do the same but in  the codes you can’t use the multiplication…

Learning Programming (for Bangali)

I found this very interesting BOOK of C Programming in Bangla and believe me or not it is fantastic for basic learners of Programming. C language is very popular language and one can say fundamental programming language too..

If you are Bangladeshi or know bangla well can check this link => http://cpbook.subeen.com/

this is a good site and you can download the book and learn the C Programming

Thoughts

A man is not known for his name or his race,he is known for his work, his thoughts towards humanity. If you need something like you others need it too. And that is humaniy and noble though of some people in this word gave us a whole different world where we live in now. Such was also the thought of iGenious Steve Jobs. In his youth he wanted some thing for himself which was the computer and though others should have or might want to have it so he made it for himself and sold them to others. This attitude led him to the Apple Inc we see now. So if you want something, need something, like yourself others need it too. Share them with others. This is not a business strategy, this is the reality of good things we see on this beautiful earth. None is perfect or can be in mare future but begin to do what you want to do now. Don’t thing to be the perfect at every sector. Try to be perfect at sharing part not how u share. Don’t be steady, stay hungry stay foolish, try to work until you die. Do what you love to do. Think every day as your last and do what things you want to do at your last stage of life. Share what is in you. Don’t keep anything inside you. Because a little thing inside you can change the world. One can change the world is the thought of someone who has changed the world not who laughs at it.

by M3AS