Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7164643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:06:31+00:00 2026-05-28T14:06:31+00:00

I have a problem with the following code #include <stdio.h> int main() /* Tidsberäkning

  • 0

I have a problem with the following code

#include <stdio.h>
int main()                /* Tidsberäkning YO */
{
    float tid1, tid2;
    printf("Tid i första åket? ");
    scanf("%f", %tid1);
    printf("Tid i andra åket? ");
    scanf(%f", &tid2);
    printf("Total Tid: %f\n", tid1+tid2);
    printf(Genomsnittlig tid: %f\n", (tid1+tid2)/2);
}

And here is the error log

c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(6): error C2059: syntax error : '%'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): error C2143: syntax error : missing ')' before '%'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): error C2198: 'scanf' : too few arguments for call`
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): error C2001: newline in constant
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): error C2065: 'f' : undeclared identifier
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): error C2143: syntax error : missing ';' before 'string'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(8): warning C4552: '%' : operator has no effect; expected operator with side-effect
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(9): error C2146: syntax error : missing ';' before identifier 'printf'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): error C2065: 'Genomsnittlig' : undeclared identifier
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): warning C4024: 'printf' : different types for formal and actual parameter 1
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): error C2146: syntax error : missing ')' before identifier 'tid'
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): error C2017: illegal escape sequence
c:\users\shaggydoo\documents\visual studio 2010\projects\ilikecake\ilikecake\hellobro.c(10): error C2001: newline in constant
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:06:32+00:00Added an answer on May 28, 2026 at 2:06 pm

    scanf(%f", &tid2);

    and

    printf(Genomsnittlig tid: %f\n", (tid1+tid2)/2);

    are missing the first quotation mark. Change to:

    printf("Genomsnittlig tid: %f\n", (tid1+tid2)/2);

    and

    scanf("%f", &tid2);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem compiling the following code: #include <stdio.h> #include <limits.h> int main
I have a problem with the following code: #include <stdio.h> #include <iostream> int main
i have following code in c++ #include <iostream> using namespace std; void qsort5(int a[],int
I have following code: #include <iostream> using namespace std; template<class T> T max(T *data,int
I have this problem with signal() : This code compiles fine: #include <stdio.h> #include
In my socket code I have the following structure: Server: #include <stdio.h> #include <stdlib.h>
i have following code for heapsort #include <iostream> using namespace std; void exch(int a[],int
I have a problem with the following code: for(i = 0;(i - 1)< n;i++)
I have a problem with the following code: protected void onDraw(Canvas canvas) { Paint
I personally have no problem with the following code if (Object foo != null

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.