Code problems is hard

This is my code

#include <stdio.h>
#include <conio.h>
 main()
   int a;
   int b
  printf("enter the first sigit");
 scanf (%d,&a);
printf ("enter the second digit ")
  scanf(%d,&b)
int c=a+b

What are you trying to do? If you’re just starting out with C, there’s plenty of courses you’ll find online. First thing that comes up:

If you’re new to programming you may find it easier and more productive to start with JavaScript. Or at least Rust if you’re keen on performance & safety, for embedded systems, networking etc.

I think the code should be like this (I might be wrong, but I think it’s this way:

#include <stdio.h>
#include <conio.h>
int main() {
  int a;
  int b;
  printf("Enter the first digit");
  scanf(" %d", &a);
  printf("Enter the second digit");
  scanf(" %d", &b);
  int c = a + b;
  return 0;
}
2 Likes