write a program using c++ input a number and reverse it?
966120
try this stuff... pls understand the logic...\n\n#include<stdio.h>\n\nint main()\n{\nint no,rem;\nscanf("%d",&no);\nwhile (no)\n{\nrem = no % 10;\nprintf("%d",rem);\nno = no / 10;\n}\n}
1178612
Well.... That's too Hard to find... i'm poor at C++...... So can't help.. have good day! Search in Google
470294
Press Alt and the numbers 164 = ñ\n\nPress Alt and the numbers 165 = Ñ
267921
You can turn these into proper C++ statements:\n\nread a, b\n\nlet max = a\n\nif max < b\n  let max = b\nendif\n\nprint max\n\nThis program assumes that a <> b.
523720
If you're asking how to convert a number (stored in binary)\ninto its decimal string, it really boils down to successive\ndivisions by 10, using the remainder as each digit (working\nfrom least significant to most).\n\nAn ugly but function version might be:\n\nchar *\nto_decimal_string(int v)\n{\n  char buff[STRSIZE];\n\n  int neg = v<0;\n  if (neg)\n    v=-v;\n\n  char *p = &buff[sizeof(buff)-1];\n  *p-- = 0;\n  if (v == 0)\n    return "0";\n  while (v>0) {\n    *p-- = "0123456789"[v%10];\n    v /= 10;\n  }\n  if (neg)\n    *p-- = '-';\n  return p+1;\n}\n\nIf you're asking how to convert an ascii string representing\na binary (base-2) number into another string representing\na decimal (base-10) number, I'd suggest using library\nroutines.  Any standard conforming C or C++ implementation\nwill provide "strtol()" and "sprintf()" (as well as other\nequivalents).\n\nThe following is purposefully done in the C subset of C++\nso that either compiler will compile it:\n\n#include <stdlib.h>\n#include <stdio.h>\n\nint\nmain(int argc, char *argv[])\n{\n  long value = strtol(argv[1], 0, 2);\n  printf("binary='%s', decimal='%d'&#92;n",\n    argv[1], value);\n  return 0;\n}\n\nThen to run it:\n\nThen to run it:\n\n$ CC convert.C\n$ a.out 10011101\nbinary='10011101', decimal='157'
129073
The code below will work.\n\nint main()\n{\nint aNum,i;\ncout<<"enter a number";\ncin>> aNum;\nfor(i=0;i<aNum;i++)\n{\nfor(j=0;j<=i;j++)//nested loop\ncout<<"*";// end of nested loop\ncout<<'&#92;n';\n}// end of outer loop\nreturn 0;\n}
604143
here is a program for 10 numbers in ascending order\n\n#include <iostream.h>\n#include <conio.h>\n\nvoid main()\n{\nclrscr();\nint array[10],t;\nfor(int x=0;x<10;x++)\n{\ncout << "Enter Integer No. " << x+1 << " : " << endl;\ncin>>array[x];\n}\nfor (x=0;x<10;x++)\n{\nfor(int y=0;y<9;y++)\n{\nif(array[y]>array[y+1])\n{\nt=array[y];\narray[y]=array[y+1];\narray[y+1]=t;\n}\n}\n}\ncout << "Array in ascending order is : ";\nfor (x=0;x<10;x++)\ncout << endl << array[x];\ngetch();\n}\n\nThis program takes in the ten integers array[x] to be stored in the single-dimensional array as a screen input from the user.\nIt then sorts out these ten integers into ascending order and prints them out using the 'cout' command.
582698
this is a default benefit provided by ms. otherwise u need to use getch() to get the output on ur screen or press alt+f5.\nif u want to remove it there is pragma supress. but to get upto that point u need to kow a lot. till then keep suffering.  :)or use any other compiler like turbo c++
274854
The difficult thing here is reading and writing the numbers. They must be transformed from ASCII and then the result transformed back to ASCII.I found a program that calculates the sum of 2 numbers.I hope it helps.
751233
I'm not sure why you are avoiding the loop, but you could use recursion instead. If I understand your question correctly this function in c++ should give you your desired results.\n\nint sum(int nbr){\n    if(nbr > 0){\n           return(nbr%10 + sum(nbr/10));       \n    }\n    else{\n         return(0);\n    }\n}\n\nIf you called it with a number such as 256, it would return an answer of 13, or the sum of each digit in the integer.
341598
If you want to convert a hex string to decimal, you\nneed to do two operations:\n\n- convert the hex string to a number\n- generate a decimal string from that number\n\nIf your system supported a full C implementation,\nit would be as simple as using scanf()/printf().\nI presume you're being asked to implement the\nprimitives yourself :-)\n\nTo convert a hex string to a number, you might\nimplement something like:\n\nint number = 0;\nwhile ((c = getchar()) != '&#92;n') {\n  if (c >= '0' && c <= '9')\n    number = (number<<4) + (c-'0')\n  else if (c>='a' && c<='f')\n    number = (number<<4) + (c-'a')\n  else if (c>='A' && c<='F')\n    number = (number<<4) + (c-'A')\n}\n\nThis could be cleaned up if you have access to the\n<ctype.h> macros [ie. isdigit() and tolower()].\n\nTo convert the number to a decimal string, you need\nto perform successive divisions by 10.  An 8051\ndoesn't have a hardware divide, but that's OK\nbecause you should have a software divide/remainder\nsubroutine.\n\nThere are two tricks to keep in mind.  First to\ngenerate the appropriate character for each digit,\nyou can treat a literal character string as an\narray.  For example:\n\nchar c = "0123456789ABCDEF"[i];\n\nwill assign the correct character to variable "c"\nbased on the value of "i" (if it is between 0 and\n15).\n\nThe other detail is that as you call the divide/\nremainder subroutine, you will generate the digits\nworking from least significant to most significant.\nTherefore, you'll want to fill an array from right\nto left.  Assuming you have a divide routine with\nthe prototype:\n\nint\ndivide(int dividend, int divisor, int *remainder)\n\nand you can use the "puts()" function to display the\ngenerated string, you might use something like:\n\nvoid\ntodecimal(int value)\n{\n  char buffer[20];\n  char*p = &buffer[sizeof(buffer)-1];\n  int remainder;\n  while (value != 0) {\n    value = divide(value, 10, &remainder);\n    *p-- = "0123456789ABCDEF"[remainder];\n  }\n  puts(p+1);\n}
344651
Hey, email me, LBphan@gmail.com, i might be able to help you out a bit, ive got some stuff for c++ and c# if youre curious, and ill give you whatever youre looking for free of charge.  my name is andy, by the way.
959413
numbers ending in -0 or -5
961194
you can use /, % operator to extract digits. \nyou also have to make two void functions. which will translate numbers into digits. \n\nvoid data(int num)\n{\n  switch(num)             \n{\ncase 0: \n         break;\ncase 1: cout<<"One ";\n         break;\ncase 2: cout<<"Two ";\n         break;\ncase 3: cout<<"Three ";\n         break;\ncase 4: cout<<"Four ";\n         break;\ncase 5: cout<<"Five ";\n         break;\n}\nand just keep going till twenty.\nand then another function which convert numbers from 20-100 into words. \n\nvoid getdata(int num)\n{\n  if(num>=90)                     \n                                  \n{\n cout<<"Ninety ";\n less20(num-90);\n}\nelse if(num>=80)\n{\n cout<<"Eighty ";\n less20(num-80);\n}\nyou have to complete it.\nexample to extract the digits for first and tenth position.\ndigit=number%10;                     \nlast_two=digit;\nnumber=number/10;\ndigit=number%10;\nlast_two=(digit*10)+last_two;\n\nnow just figure out the positions. \nand you are good.
312194
I am not sure if this is what you mean.\n\n#include <iostream>\n\nusing namespace std;\n\nvoid main() {\n\n    char ch;\n    cout << "Type in a character, then press enter.&#92;n";\n    cin >> ch;\n    cout << "&#92;nYou typed: ";\n    cout << ch;\n}\n\nThat will read one character from the keyboard for you.\nIt was intentionally made simple.\n\njack573
1056394
Try this link from Planet Source Code. It's in C++, but you should be able to convert it to C:\nhttp://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=5602&lngWId=3
810525
Move the decimal two places to the left.\n.3455