Home > Backend Development > C#.Net Tutorial > C# Learning Diary 10----Extra Chapter C Language Base Conversion

C# Learning Diary 10----Extra Chapter C Language Base Conversion

黄舟
Release: 2017-01-20 13:39:55
Original
1609 people have browsed it

I left a question in C# Learning Diary 08---Character Type: How to write a hexadecimal conversion program in C. Now I will eradicate this sequelae:

#include<stdio.h>  
int main()  
{  
   printf("请输入一个十进制数:");  
       int a;  
       scanf("%d",&a);  
       printf("十进制 %d 的十六进制是: %x\n",a,a);   //  %d十进制转义符 %x 十六进制转义符  
       printf("十进制 %d 的八进制是: %o\n",a,a);     //  %o  八进制转义符   
  
       return 0;  
  
  
}
Copy after login

Debug:

C# Learning Diary 10----Extra Chapter C Language Base Conversion

No problem, the result is correct! !

The above is the content of C# Learning Diary 10----Extra Chapter C language binary conversion. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template