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?
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
Ela ela 2nd ekath wada...........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
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 ?????
tama learning ne hehechamidilk 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 ?????
chamidilk said:mama danna widiyata CIN wala formatting baha
mama thama L1
eeth hithan inne tronix karanna

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"};
umbanam kiyai..Mama next week submit karanna oni.........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
Mchhho mama godak durata pracice kala...Apita kohomath lecture ekakuth miss vuna wednesday holiday nisa..Eka nam wadakuth ne...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
Avulak ne ban...Mama thaama if conditions valin ehaata thaaama paadam kale ne...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
#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);
}
Ayyo banz avulak ne!!!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 ????
senewimala1988 said:Ayyo banz avulak ne!!!
Eka elakiri wage wada..
he hechamidilk said:eka misak mama baluwa moko kiyala
#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");
}
#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");
}