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
Toyota Vitz scp10 For Sale
Lakmal Bandara
Updated:
Today at 10:50 AM
Ad icon
Cam ෂෝ කරන්න ආස කෙල්ලෝ
vip video seller srilanka
Updated:
Today at 2:17 AM
Cam show job
vip video seller srilanka
Updated:
Today at 2:01 AM
Vip විඩීයෝ තියේ හොරෙන් රෙකෝඩ් කරපුවා
vip video seller srilanka
Updated:
Today at 1:26 AM
Kandy
Welcome all my all new pet shop Bark.lk
dilumrane
Updated:
Monday at 12:26 PM
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
Hata thunen beduwama keeyada? (60 bedeema thuna)
Post reply
Top
Bottom