Thread: whats wrong with this simple calculator

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2022
    Posts
    4

    whats wrong with this simple calculator

    Code:
    #include <stdio.h>
    
    int main(void){
        int fnumber,snumber;
        printf("enter fnumber=");
        scanf("%d",&fnumber);
        printf("enter snumber=");
        scanf("&d",&snumber);
        printf("total=%d",fnumber+snumber);
        return 0;
    }
    when i enter a fnumber, it proceeds immediately to total without asking for snumber.
    Attached Images Attached Images whats wrong with this simple calculator-untitled-png 

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. whats wrong in this simple program
    By san12345 in forum C Programming
    Replies: 3
    Last Post: 12-14-2015, 07:50 AM
  2. simple calculator: what's wrong with this code?
    By zer0_r00t in forum C Programming
    Replies: 14
    Last Post: 06-01-2014, 09:13 PM
  3. whats wrong with this very simple code?
    By sway1 in forum C++ Programming
    Replies: 2
    Last Post: 07-06-2008, 12:18 PM
  4. Whats wrong with this simple code?
    By o14v in forum C++ Programming
    Replies: 4
    Last Post: 03-19-2008, 01:46 PM
  5. Whats Wrong in My simple program?
    By MartinLiao in forum C Programming
    Replies: 1
    Last Post: 09-02-2004, 02:30 AM

Tags for this Thread