Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
🔒 NordVPN Premium – 3 Months
hrdilshan
Updated:
Yesterday at 8:29 PM
🚀 Microsoft Office 365 Pro Plus – Lifetime Access! 🚀
hrdilshan
Updated:
Yesterday at 8:28 PM
Linkedin Premium Business / Careere /Sales Navigator - 1/2/3/6/9/12 Months - Reddem Link
hrdilshan
Updated:
Yesterday at 8:27 PM
Colombo
YEYE 3 in 1 Instant Coffee Mix 50 Sachet
Romeshka
Updated:
Wednesday at 12:16 AM
Colombo
Red Hat Certified System Administrator (RHCSA) - RHEL 10
Sanjeewani95
Updated:
Jul 3, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
C Programmers Help Me!!!!
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="senewimala1988" data-source="post: 3966427" data-attributes="member: 63023"><p>Here are two simple exercise on C programming language. Please give me the coding for these program(at least for the second exercise)(The second one is the most important exercise)</p><p></p><p> <strong> Exercise 1:</strong></p><p> Write a program to input a temperature reading in either Celsius(c) or Fahrenheit(f) scale and convert it to the other scale. The temperature reading consist of a decimal integer followed by letter “F” or “f” if the temperature is in Fahrenheit scale or letter “C” or “c” if it is in Celsius scale. You may use a similar format for the output of the program.</p><p> </p><p></p><p> Note: c=5*(f-32)/9</p><p> </p><p></p><p> $ ./a.out</p><p> Temperature reading: 100C</p><p> 212F</p><p> </p><p></p><p> $ ./a.out</p><p> Temperature reading: 100F</p><p> 37C</p><p> </p><p></p><p> <strong>Exercise 2:</strong></p><p> Give a date as a triplet of numbers(<strong>y,m,d</strong>), with<strong> y </strong>indicating the year, <strong>m</strong> the month(m=1 for January, m=2 for February, etc.), and <strong>d</strong> the day of the month, the corresponding day of the week <strong>f</strong>(f=0 for Sunday, f=1 for Monday, etc.), can be found as follows:</p><p> </p><p></p><p> (a)if m<3 let m=m+12 and let y=y-1</p><p> (b)let a=2m+6(m+1)/10</p><p> (c)let b=y+y/4-y/100+y/400</p><p> (d)let f1=d+a+b+1</p><p> (e)let f=f1 mod 7</p><p> (f)stop.</p><p> </p><p></p><p> Write a program that will read a date and print the corresponding day of the week. All divisions indicated above are integer divisions.</p><p></p><p></p><p><img src="/styles/default/xenforo/smilies/default/sad.gif" class="smilie" loading="lazy" alt=":(" title="Sad :(" data-shortname=":(" /><img src="/styles/default/xenforo/smilies/default/sad.gif" class="smilie" loading="lazy" alt=":(" title="Sad :(" data-shortname=":(" /><img src="/styles/default/xenforo/smilies/default/sad.gif" class="smilie" loading="lazy" alt=":(" title="Sad :(" data-shortname=":(" /></p></blockquote><p></p>
[QUOTE="senewimala1988, post: 3966427, member: 63023"] Here are two simple exercise on C programming language. Please give me the coding for these program(at least for the second exercise)(The second one is the most important exercise) [B] Exercise 1:[/B] Write a program to input a temperature reading in either Celsius(c) or Fahrenheit(f) scale and convert it to the other scale. The temperature reading consist of a decimal integer followed by letter “F” or “f” if the temperature is in Fahrenheit scale or letter “C” or “c” if it is in Celsius scale. You may use a similar format for the output of the program. Note: c=5*(f-32)/9 $ ./a.out Temperature reading: 100C 212F $ ./a.out Temperature reading: 100F 37C [B]Exercise 2:[/B] Give a date as a triplet of numbers([B]y,m,d[/B]), with[B] y [/B]indicating the year, [B]m[/B] the month(m=1 for January, m=2 for February, etc.), and [B]d[/B] the day of the month, the corresponding day of the week [B]f[/B](f=0 for Sunday, f=1 for Monday, etc.), can be found as follows: (a)if m<3 let m=m+12 and let y=y-1 (b)let a=2m+6(m+1)/10 (c)let b=y+y/4-y/100+y/400 (d)let f1=d+a+b+1 (e)let f=f1 mod 7 (f)stop. Write a program that will read a date and print the corresponding day of the week. All divisions indicated above are integer divisions. :(:(:( [/QUOTE]
Insert quotes…
Verification
Dahaya deken beduwama keeyada?
Post reply
Top
Bottom