0

Why my code is not working?

#include<studio.h> int main (){ int num; printf("Enter any number\n); scanf("%d",&num); for (int i =1, i<10, i++) int result=num*i; printf("%d ×%d =%d", num,i, result); } return 0; }

19th Oct 2023, 1:19 PM
virendra singh
virendra singh - avatar
2 Réponses
+ 7
virendra singh Few errors in your code,Let's discuss about the error. #First:- typo in the `#include` statement. It should be `#include <stdio.h>` instead of `#include<studio.h>`. #Secound:- In`for` loop, missing semicolons(;). It should be `for (int i = 1; i < 10; i++)`. #Third:- missing " " in printf statement..it should be `printf("Enter any number:\n");` #See this modified version.. https://code.sololearn.com/cTduK0Y1Xri8/?ref=app #Attention plz:- Always use only correct tags..for example use your code is related to c language so use only `c` Tags, instead of `codeplayground`.
19th Oct 2023, 1:30 PM
Darpan kesharwani🇮🇳[Inactive📚]
Darpan kesharwani🇮🇳[Inactive📚] - avatar
+ 1
Corrected version #include<stdio.h> int main (){ int num; printf("Enter any number\n"); scanf("%d",&num); for (int i =1;i<=10;i++){ int result=num*i; printf("%d ×%d =%d\n", num,i, result); } return 0; }
21st Oct 2023, 7:20 AM
Abhay Gomkale
Abhay Gomkale - avatar