- This topic is empty.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Software programming learning aide
CS50 threads to aide as a supplementary resource › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 1 › What is wrong with this if statement
Tagged: conditional statement in c, if statement
#include<stdio.h>
#include<cs50.h>
int main (void)
{
int t = get_int("enter cents");
int count25 = t/25;
t = t%25;
printf("%i",t);
If (t > 9)
{
int count10 = t/10;
}
else
{
count10 = 0;
}
printf("count10 is%i",count10);
}
Not sure why error showing with
if (t > 9)
t is an integer variable type.
Reply
https://edstem.org/us/courses/176/discussion/1691122[learn_press_profile]