C Programmers Help Me!!!!

madurax86

Member
Jun 29, 2006
4,385
88
0
chamidilk said:
macho ara day eka kiyana prog eke input eka mama dunne me widiyata honde
look at dz instance
ex-: input-----> 2009-2-13
output-----> Friday

me c++ wala cin ekata input format karana puluwan da?
 

madurax86

Member
Jun 29, 2006
4,385
88
0
chamidilk said:
no macho I study in University of Moratuwa ....
Why did you ask me whether I studied in SLIIT ..... ????
macho CPP wala oya switch case eka ain karala kelinma String array ekak ganna puluwan neda ?????

ow eka mathak une na :P tama learning ne hehe
 

¤--bACarDi--¤

Well-known member
  • Jan 9, 2009
    12,130
    288
    83
    124.43.xxx.xxx
    chamidilk said:
    no macho I study in University of Moratuwa ....
    Why did you ask me whether I studied in SLIIT ..... ????
    macho CPP wala oya switch case eka ain karala kelinma String array ekak ganna puluwan neda ?????

    Ne banz SLIIT eketh me dawas wala owa thamai karanney...;)
    Uba Moratuwa Software Engeneering wenna one...!!!
    1st year or 2nd Year...?
     

    VIDUrUVAN123

    Member
    May 24, 2007
    2,914
    10
    0
    Sri lanka
    machang try to lean your self these are the most eassy programs in C

    machang first try to write pseudo codes and take a logic behind it

    then code machang

    Then put the codes we will help you
     

    chamidilk

    Active member
  • Nov 18, 2006
    1,053
    4
    38
    Moratuwa
    balanna

    Code:
    ow umbata puluwan nam ee prog eka methana danna balanna 
     c whether my String array declaration in cpp is correct
    
    ........
    ........
    #include<string.h>
    int main(){
    .............
    .............
    ........
    String s[]= {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
     

    senewimala1988

    Well-known member
  • Dec 5, 2007
    7,745
    2,593
    113
    Kadawatha, Sri Lanka
    VIDUrUVAN123 said:
    machang try to lean your self these are the most eassy programs in C

    machang first try to write pseudo codes and take a logic behind it

    then code machang

    Then put the codes we will help you
    umbanam kiyai..Mama next week submit karanna oni.........
     

    chamidilk

    Active member
  • Nov 18, 2006
    1,053
    4
    38
    Moratuwa
    naha macho api pseudo code walin programming start eka 1st semester waladi gatta ne ????
    umba oya Lab Notes wala thiyena ewwa mula idan gahala purudu wenna kohomada program flow eka kiyala
    anith eka syntax tikath balaganna
     

    senewimala1988

    Well-known member
  • Dec 5, 2007
    7,745
    2,593
    113
    Kadawatha, Sri Lanka
    chamidilk said:
    naha macho api pseudo code walin programming start eka 1st semester waladi gatta ne ????
    umba oya Lab Notes wala thiyena ewwa mula idan gahala purudu wenna kohomada program flow eka kiyala
    anith eka syntax tikath balaganna
    Mchhho mama godak durata pracice kala...Apita kohomath lecture ekakuth miss vuna wednesday holiday nisa..Eka nam wadakuth ne...
    Mata ara temperature eka haduwa..But eka two times input karanna oni...1st either celsius or fahrenheit..2nd the temperature..
    Mata 2nd eka nam therune ne..
    1st ekath thaniyen practice karala thama hada gaththe..Eth oya dunnu vidiye advance yanna mage knowledge eka madi!!!

    /*Program-4.1*/
    #include<stdio.h>
    int main()
    {
    char temp;
    float C,F;
    printf("What is your input type(C/F)?");
    scanf("%c",&temp);
    if(temp=='C')
    {
    printf("Type your temperature in Celsius: ");
    scanf("%f",&C);
    F=(9*C/5)+32;
    printf("Temprature reading: %.2f",F);
    printf(" F\n");
    }
    else if(temp=='F')
    {
    printf("Type your temperature in Farenheit: ");
    scanf("%f",&F);
    C=5*(F-32)/9;
    printf("Temperature Reading: %.2f",C);
    printf(" C\n");
    }
    else
    printf("STOP! Wrong input\n");
    return 0;
    }
     

    chamidilk

    Active member
  • Nov 18, 2006
    1,053
    4
    38
    Moratuwa
    okath ithin aulak nahane .... ???

    mama deepu prog eke umbata ewelawema denna puluwan Celsius da Farenheit da kiyala ???

    ai mage prog eka therenne naththe ???
    mokakda aula
     

    senewimala1988

    Well-known member
  • Dec 5, 2007
    7,745
    2,593
    113
    Kadawatha, Sri Lanka
    chamidilk said:
    okath ithin aulak nahane .... ???

    mama deepu prog eke umbata ewelawema denna puluwan Celsius da Farenheit da kiyala ???

    ai mage prog eka therenne naththe ???
    mokakda aula
    Avulak ne ban...Mama thaama if conditions valin ehaata thaaama paadam kale ne...
    E hinda tikak advance yanna amaarui..
    Eth avulak ne..
    Mama JAVA yaantham karala thiyenavaa..
    Eka hinda tikak therum ganna puluwan...
     

    chamidilk

    Active member
  • Nov 18, 2006
    1,053
    4
    38
    Moratuwa
    aula moko

    Code:
    #include<stdio.h>
    main(){
    	int c;
    	char type;
    	printf("Temperature reading: ");
    	scanf("%d%c",&c,&type);
    	if((type=='c'||type=='C')){
    		printf("%dF",F(c));
    	}
    	else if((type=='f'||type=='F')){
    		printf("%dC",C(c));
    	}
    	else printf("Invalid Entry\nTry Again");
    }
    
    int C(int i){
    	return (5*(i-32)/9);
    }
    int F(int i){
    	return (32+9*i/5);
    }


    mokakda aula
    compile wenne nadda ????
     

    senewimala1988

    Well-known member
  • Dec 5, 2007
    7,745
    2,593
    113
    Kadawatha, Sri Lanka
    chamidilk said:
    Code:
    #include<stdio.h>
    main(){
        int c;
        char type;
        printf("Temperature reading: ");
        scanf("%d%c",&c,&type);
        if((type=='c'||type=='C')){
            printf("%dF",F(c));
        }
        else if((type=='f'||type=='F')){
            printf("%dC",C(c));
        }
        else printf("Invalid Entry\nTry Again");
    }
    
    int C(int i){
        return (5*(i-32)/9);
    }
    int F(int i){
        return (32+9*i/5);
    }

    mokakda aula
    compile wenne nadda ????
    Ayyo banz avulak ne!!!
    Eka elakiri wage wada..
     

    chamidilk

    Active member
  • Nov 18, 2006
    1,053
    4
    38
    Moratuwa
    regarding ur request

    I found tht de program u all asked me wz based on basic control structures .
    bt de program u were all given first wz highly cohesive n readable ....
    bt i thought all hd no clear idea of functions
    here is de new prog

    Code:
    #include<stdio.h>
    main(){
    	int i;
    	char type;
    	printf("Temperature reading: ");
    	scanf("%d%c",&i,&type);
    	if((type=='c'||type=='C')){
    		printf("%dF",(32+9*i/5));
    	}
    	else if((type=='f'||type=='F')){
    		printf("%dC",(5*(i-32)/9));
    	}
    	else printf("Invalid Entry\nTry Again");
    }
     

    x-pert

    Member
    Jun 13, 2006
    20,952
    77
    0
    Explanation:

    Code:
    #include<stdio.h>
    main(){
        int i;
        char type;
        printf("Temperature reading: ");
        scanf("%d%c",&i,&type);    
    [COLOR=DarkGreen][B]//  %d kiyana eken capture karanne INTEGER values.
    // %c kiyana eken capture karanne CHAR values. 
    // ethakota oya uda line eken wenne, keyboard input eke thiyana integer values tika
    // assign wenawa 'i' kiyana variable ekata. and...
    // Char values tika assign wenawa 'type' kiyana variable ekata. [/B][/COLOR]
    
        if((type=='c'||type=='C')){
            printf("%dF",(32+9*i/5));
    [B][COLOR=DarkGreen]// Enter karapu eke 'type' eka c or C nam, do the above calculation to 'i'[/COLOR][/B]
        }
    
    
        else if((type=='f'||type=='F')){
            printf("%dC",(5*(i-32)/9));
        }
    [COLOR=DarkGreen][B]// Enter karapu eke 'type' eka f or F nam, do the above calculation to 'i'[/B][/COLOR]
    
    
        else printf("Invalid Entry\nTry Again");
    }