Contact Learn C
Copy

Program 226: Decryption of Numeral Code using C

Program 226
 
#include<stdio.h>
#include<math.h>
main()
{
//Converts ascii value to base=2 or base=3 or base=4 etc including space and everything
//Ex:ABCDE-base=2:- Same as binary code encryption
//Ex:ABCD-base=3:-A-1001,B-1002,C-1003,D-1004 
int i,j,n,temp,x,decimal=0,base,inc;
  printf("Enter how many numbers are there\n");
 scanf("%d",&n);
 int num[n];
 printf("Enter numbers separated by space\n");
 for(i=0;i<n;i++)
 {
  scanf("%d",&num[i]);
 }
 printf("Enter base value to encrypt starting from 2\n");
 scanf("%d",&base);
 if(base>1)
 {
 
 printf("Decrypted Numeral code\n");
  for(i=0;i<n;i++)
  {  
      inc=0;
      decimal=0;
      temp=num[i];
      while(temp!=0)
       {
         x=temp%10;
         decimal=decimal+(x*pow(base,inc));
         temp=temp/10;
         inc++;
        }        
        printf("%c",decimal);
  }
  printf("\n");
 }
 else
 {
  printf("Please Enter base greater than or equal to 2\n");
 }
}
Explanation:
//Coming Soon

Output: 

Decryption of Numeral Code using C

Decryption of Numeral Code using C






 

3 comments:

  1. factorial hundred In the last few days, the “factorial of 100” is one of the top subjects and a lot of maths geeks compute it using voice assistants such as Alexa, Shiri, etc.
    auto-accident-compensation-claims-in-michigan When needing to hire a car accident lawyer, you want someone you can trust to see your case through to the end.
    car-accident-lawyer-san-fernando-valley When needing to hire a car accident lawyer, you want someone you can trust to see your case through to the end.

    ReplyDelete
  2. factorial hundred In the last few days, the “factorial of 100” is one of the top subjects and a lot of maths geeks compute it using voice assistants such as Alexa, Shiri, etc.
    eiffel tower macau Aurecon was involved in the design and design of the unique new structure. We provided complete structural engineering advice for the project and assisted with keeping the original design.
    car-accident-lawyer-columbus-ga Although the aftermath of a car accident may only last for a second, the physical, financial, and emotional consequences of a wreck can last for the rest of your life.

    ReplyDelete
  3. college-party-guide One of the most important rituals for students in college is to throw the most memorable student dorm celebration.
    gigolo The term”gigolo” usually refers to the person who lives an arranged lifestyle that includes many of these relationships in a series, rather than having any other support system.
    sniffies Sniffies isn’t bookmarked on my phone, however I’ve been logged in enough that the web target will auto-complete on my personal browser.
    erome However, there’s a challenge with streaming online. There are some limitations when streaming online videos. We are limited by the speed of internet, access to internet and other internet-related issues.

    ReplyDelete

Donate

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide