tag:blogger.com,1999:blog-959939550345671470.post6391231912282279613..comments2024-03-24T12:51:18.535+05:30Comments on C programming Interview questions and answers: C program to convert Roman number to decimal numberPriyanka kumarihttp://www.blogger.com/profile/08145649011863585828noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-959939550345671470.post-69414349981013288352017-02-18T00:18:41.418+05:302017-02-18T00:18:41.418+05:30#include
int main()
{
int n,a=1;
printf("ente...#include<br />int main()<br />{<br />int n,a=1;<br />printf("entetr the num.");<br /><br />do<br />{<br />scanf("%d",&n);<br />while(n>=1000 || n>=900)<br />{<br />if(n>=1000)<br />printf("M",n=n-1000);<br />else if(n>=900)<br />printf("CM",n=n-900);<br />}<br />while(n>=500 || n>=400)<br />{<br />if(n>=500)<br />printf("D"Anonymoushttps://www.blogger.com/profile/07711306868755693184noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-35269546160370294232015-12-03T04:45:50.743+05:302015-12-03T04:45:50.743+05:30is it possible to have one that starts with
int r...is it possible to have one that starts with <br />int romanToInt(char *s){<br />...<br />//and ends with <br />...<br />return -1;<br />} /* romanToInt */tahuhuhttps://www.blogger.com/profile/05144899949730701386noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-75883537763998622212015-12-03T04:45:25.945+05:302015-12-03T04:45:25.945+05:30is it possible to have one that starts with
int r...is it possible to have one that starts with <br />int romanToInt(char *s){<br />...<br />//and ends with <br />...<br /> return -1;<br />} /* romanToInt */tahuhuhttps://www.blogger.com/profile/05144899949730701386noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-74755851415438738282015-10-29T06:36:46.483+05:302015-10-29T06:36:46.483+05:30This is probably the shortest/simplest solution to...This is probably the shortest/simplest solution to this problem<br /><br />#include < stdio.h ><br /><br />void main(){<br /> char ROMAN[][3] = { "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I" };<br /> int NUM[] = { 1000, 900, 500, 400, 100Anonymoushttps://www.blogger.com/profile/13715212757799817831noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-69860492737459901672015-10-17T20:35:58.941+05:302015-10-17T20:35:58.941+05:30Could you explain this part for me?
if(digitValue...Could you explain this part for me?<br /> if(digitValue(roman_Number[i]) >= digitValue(roman_Number[i+1]))<br /> number = number + digitValue(roman_Number[i]);<br /> else{<br /> number = number + (digitValue(roman_Number[i+1]) - digitValue(roman_Number[i]));<br /> i++;<br /> }<br /> i++;<br /> }Anonymoushttps://www.blogger.com/profile/00953224009304397562noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-81125486705053092782015-08-02T17:57:53.169+05:302015-08-02T17:57:53.169+05:30Check This Code
may be it is simpler than your cod...Check This Code<br />may be it is simpler than your code<br /><br />#include <br />#include <br />int main()<br />{<br />int a[10],len,i,j,val;<br />char rom[20];<br />printf("Enter the Roman Numeral:");<br />scanf("%s",rom);<br />printf("%s",rom);<br />i=0;<br />while(rom[i]!='\0')<br />{<br /> if(rom[i]=='I')<br /> a[i]=1; <br /> else if(rom[i]==&#Srikanth Chindamhttps://www.blogger.com/profile/08329328541075753896noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-32966414870602933972015-04-12T17:50:39.480+05:302015-04-12T17:50:39.480+05:30Using c language, the input and output are 0 and 1...Using c language, the input and output are 0 and 1. Its output is identical to the input in the even position but inverted in the odd position. For example, input 0000111 it output 1010010. How to do this ?fedillah kohhttps://www.blogger.com/profile/01572402005745530263noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-81563180399378261922014-12-23T08:17:26.115+05:302014-12-23T08:17:26.115+05:30This comment has been removed by the author.Srikanth Chindamhttps://www.blogger.com/profile/08329328541075753896noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-89447582318198842672014-12-23T08:15:56.224+05:302014-12-23T08:15:56.224+05:30This comment has been removed by the author.Srikanth Chindamhttps://www.blogger.com/profile/08329328541075753896noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-17422481203539084032013-07-16T09:07:09.263+05:302013-07-16T09:07:09.263+05:30pls give some description of this program.
pls give some description of this program.<br />Anonymoushttps://www.blogger.com/profile/12156494013415430439noreply@blogger.com