Hey guys guys... i developed my first c program. it is simple.. please check it !!

cow_theboy

Member
Dec 14, 2006
1,480
1
0
Mahavilachchiya
Hey guys guys... i developed my first c program. it is simple.. please check it !!

oyalage comments denna hodada???

mekata ithin program ekak kiyalama kiyannath bee.. eth ithin first ekane... thawama pataaaaaaan gaththa witharaiiiiiii!!!!!!
:yes: :yes: :yes: :yes: :yes:
 

Attachments

  • first program in c.zip
    9.2 KB · Views: 121

cow_theboy

Member
Dec 14, 2006
1,480
1
0
Mahavilachchiya
Ranhiru said:
Hondai hondai machan....me wage podi podi program wala source code ekath danna machan...ethakota anith ayata igena gannath puluwan :)

yess... menna source code eka..
/* meka mage first program eka hodada */
#include<stdio.h>
#include<conio.h>
main()
{
int a, b,tot,c;
clrscr();
printf("\nThis software is developed by \n Ranuka Udayanga \n [email protected] \n

www.*********.com\n ");
printf("\n\n1st grade addition software\n");
printf("\n Enter First No\n");
scanf("%d", &a);
printf("\nEnter second no\n");
scanf("%d",&b);
tot = a + b;
printf("\nwhat is the answer\n");
scanf("%d", &c);
if( c == tot)
printf("\nYour are correct!!\n");
else
printf("\n you are incorrect \n\n Please go to grade 1 and learn

mathematics\n\n");
printf("Correct answer is %d", tot);
getch();
return(0);
}
 

ram4mira

Active member
  • Jan 14, 2007
    2,628
    17
    38
    36
    Machan Number ekata characters gahanna bari karapan...Man mulin "No " gahuwa therenne nathi nisa....ethakota Okkoma run wela passe aththa uththarayak enawa answer is=30**(mataka na)

    Any wy gud luck kolla!

    Any wy mamath igena gannawa...Bt not c++...man karanne Java...
     
    Last edited:

    x-pert

    Member
    Jun 13, 2006
    20,952
    77
    0
    ElaKiri machang. Good job.

    Next step should be to validate the input.

    Try it out :D

    Hint:
    You might need to enter a masking aftr every input like
    printf("\n Enter First No\n");
    scanf("%d", &a);
    if (a>=-9999 && a<9999) printf("Enter second number") scanf("bla bla")
    else printf("invalid input... please enter a valid number again")
     

    cow_theboy

    Member
    Dec 14, 2006
    1,480
    1
    0
    Mahavilachchiya
    x-pert said:
    ElaKiri machang. Good job.

    Next step should be to validate the input.

    Try it out :D

    Hint:
    You might need to enter a masking aftr every input like
    printf("\n Enter First No\n");
    scanf("%d", &a);
    if (a>=-9999 && a<9999) printf("Enter second number") scanf("bla bla")
    else printf("invalid input... please enter a valid number again")

    yesss.. thawama eka dawasai lectures thibbe.. apita thawa if kiyala dunneth nehe.. mama arakata demmeth guesss karala... hehe... :cool: :cool: :cool:
     

    fazaal24

    Member
    Nov 10, 2006
    33,026
    18
    0
    Carbon Canyon Dehiwala
    Wow elakiri machan :) Maath langadi indan thamai C patan gaththe :D Keep it up :)

    EDIT:

    Machan mama nikan Akuru dekak gahala baluwa(instead of numbers). Ethakotath uththarayak enawa neda? Eeka hadanna dannawada? just wanna learn :D XP kiwwa wage Validate karanna wei neda?
     
    Last edited: