Thread: I need help with c programming

  1. #1
    Registered User
    Join Date
    Mar 2020
    Posts
    2

    Post I need help with c programming

    I can't separate 8 bits the encryption code given in option 2.

    Can someone help me about this problem.I have provided the necesaary information below.
    Attached Images Attached Images I need help with c programming-1-jpg I need help with c programming-2-jpg I need help with c programming-3-jpg 
    Last edited by cansas28; 03-02-2020 at 04:02 PM.

  2. #2
    Registered User
    Join Date
    Mar 2020
    Posts
    2
    I have write like this Ubuntu Pastebin for just option 2 and it doesn't work.

    Code:
    else if(options==2){
    			
    			
    			int base,sayi,a,i;
    			
    			printf("You have chosen option 2!\n");
    			
    			printf("Which base will you use to enter text (base 16/2)?");
    			
    			scanf("%d",&base);
    			fflush(stdin);
    			
    			if(base==2){
    				char x;
    				int num=2,i=0,sb,str=0;
    				printf("Please enter the text to encrypt:");
    				scanf("%c",&x);
    			
    				while(x!=10)
    				{
    					if(x==48)
    					{
    						num*=10;
    					}
    					else if(x==49)
    					{
    						num=num*10+1;
    					}	
    					scanf("%c",&x);
    				}
    				printf("\n--%d",num);
    Last edited by Salem; 03-02-2020 at 11:40 PM. Reason: inlined code from expiring external site

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Maybe you could try posting less fuzzy images.
    Ones without massive useless grey borders would be helpful.

    Also your 'friend' with the same question.
    My code does not work properly. I need help.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 02-01-2019, 12:27 PM
  2. Replies: 0
    Last Post: 02-01-2019, 12:22 PM
  3. Replies: 4
    Last Post: 12-11-2011, 04:25 PM
  4. small programming job VCPP / Object Oriented Programming
    By calgonite in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 01-04-2006, 11:48 PM
  5. Total newb to programming here... Question about the many programming languages. Ty!
    By tsubotakid1 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 10-05-2003, 10:32 AM

Tags for this Thread