Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

closed My code is not working. Why?

+5 votes
asked May 12, 2021 by 20-CM-043 K kumar (170 points)
closed Sep 20, 2021 by Admin
#include <stdio.h>

int main() {
  float num1;
  double num2;
  int num3;

  printf("Enter a number: ");
  scanf("%f", &num1);
  printf("Enter another number: ");
  scanf("%lf", &num2);
  printf("other one: ");
  scand("%d",  &num3);
  

  printf("num1 = %f\n", num1);
  printf("num2 = %lf", num2);
  printf("\n");
  printf("num3 = %d", num3);

  return 0;
}
closed with the note: answered

12 Answers

+1 vote
answered Jun 29, 2021 by Ajay kattimani (160 points)
#include <stdio.h>

int main() {
  float num1;
  double num2;
  int num3;

  printf("Enter a number: ");
  scanf("%f", &num1);
  printf("Enter another number: ");
  scanf("%lf", &num2);
  printf("other one: ");
  scanf("%d",  &num3);
  

  printf("num1 = %f\n", num1);
  printf("num2 = %lf", num2);
  printf("\n");
  printf("num3 = %d", num3);

  return 0;
}
0 votes
answered Jun 29, 2021 by himanshu sharma (140 points)

replace    scand   with scanf  

smiley

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...