+ 1
Can anyone check the program below ? I want values to be enter by user but after entering the loop it won't let the values to be
#include<stdio.h> #include<conio.h> int main() { int a[100]; int n, max, k; printf("enter the size of array:"); scanf("%d", &max); printf("enter the elements you want to enter\n"); max==a[n]; n=n+1; for(n=0; n<=max; n++) printf("a[%d] is \n ",n); scanf("%d", &a[n]); for(n=0; n<=max; n++) printf("entered elements are a[%d] is %d\n",n,a[n]); getch(); }
4 ответов
+ 1
What is that you are trying to achieve from the code you shared. Do you just want to take user input, store them in an array and display them? Or is it something different?
+ 1
Can you explain what you expected from the code? I mean what it should take and what output was expected.
0
Plz everyone be sure to review this post
0
I don't understand what max==a[n] and next line are supposed to do and I think it's unnecessary. For sure you need braces in both for loops.