Thread: Get wrong answer in code::Blocks for C programm

  1. #1
    Registered User
    Join Date
    Jun 2021
    Posts
    2

    Get wrong answer in code::Blocks for C programm

    Hi
    I've been started to learn C program with code::blocks
    I downloaded this version (codeblocks-20.03mingw-setup) from the site

    Now when I just write a simple code for sum two digit, I get wrong result,
    for example : 3+5 get 16 for answer
    I put the screen from the operation and run and result

    Please someone help me
    I don't know what to do
    Attached Images Attached Images Get wrong answer in code::Blocks for C programm-screenshot-20-jpg 

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    It should be
    scanf("%d", &a);
    not
    scanf("%d, &a");

    You got the end " in the wrong place.

    The compiler should have warned you.
    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.

  3. #3
    Registered User
    Join Date
    Jun 2021
    Posts
    2
    Thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code generating wrong answer
    By ec661 in forum C Programming
    Replies: 6
    Last Post: 04-04-2019, 09:41 PM
  2. Help! always getting wrong answer.
    By V8cTor in forum C++ Programming
    Replies: 2
    Last Post: 07-10-2015, 12:22 AM
  3. Getting Wrong answer ???
    By Fazot in forum C++ Programming
    Replies: 1
    Last Post: 07-28-2012, 08:45 AM
  4. Wrong answer?
    By eViLrAcEr in forum C++ Programming
    Replies: 5
    Last Post: 07-16-2009, 06:04 AM
  5. wrong answer?
    By cman in forum C Programming
    Replies: 5
    Last Post: 03-09-2003, 02:17 AM

Tags for this Thread