Questions tagged [else]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
18 views

Pset2 Readability error with “else” statement

readability.c:28:9: error: expected expression else: Shown above is the error I am getting. If anyone would point me to what exactly I am doing wrong. that would be great. Bellow, I will add my ...
0
votes
1answer
101 views

Else is ruining my code in dna and I don't get why

I'm trying to record the longest run of each STR I need and I'm close. Without the final "else" the code works fine with small dictionary and almost fine with long (because the count I ...
0
votes
1answer
106 views

pset1 - credit - if-else statement issue

I have written a (clumsy) solution to the credit pset1. However, the solution only works for "Mastercard" credit card numbers (i.e. 5555555555554444). For "Visa" and "Amex" my code does return the ...
1
vote
1answer
41 views

Output of characters at specific place place using uint_list

I am trying to make an output using 3 characters (vertical line, plus sign, minus sign) and using uint_list to increase or reduce the length. #include <stdio.h> #include <stdlib.h> #...
0
votes
1answer
43 views

The ide returns an error saying “ilist index out of range” pointing to the initialisation of int k

if (len(sys.argv) != 2): print("please enter a key") """understand the key""" k = sys.argv[1] """prompt for input text""" message = cs50.get_string("plaintext:") """get ready to produce ...
0
votes
1answer
405 views

pset1 - Greedy Errors “error: expected expression”

Please help! I cant solve some errors (from: [http://docs.cs50.net/problems/greedy/greedy.html][1]) running this code: int main(void) { float change = 0; int coin_used = 0; int change2 = ...
0
votes
1answer
65 views

Why this code doesn't work?

I just started learning programming couple of days ago, and I made this for fun but it doesn't work on if and else with string.. what should I fix? #include <stdio.h> #include <cs50.h> ...