what is this "int c[]={42,3,4,5,1,2,3,7,8,9,0,1,2,3,4,5,6,7,8,4};"
your code prints nothing.
how you are reading the input? what are you doing with "c[]".
Read the problem statement once again.
Still you don't understand what problem is asking for.answer my question.-->How you are reading the input?
array c is my input
i am nt taking inputs from console.
You have to take input form console not from a self initialize array.
Thanks for your help.. But,I think that they should be more worried about logic instead of the source of input...Anyways I will take care of all the things that you have told me and try to solve some good problems.
How come the judge understand your logic until you process the given input and print the desired output..
I don't understand what actually you are trying to do.
anyway..good luck.
What is the input constraint for this problem???I am getting a run time error..
If you are looking for a maximum on the number of integers in the input, there is none. There could be 5, there could be one billion.
Hi everyone, i don't understand what is wrong in my code... if someone can help me...
#include <stdio.h> int main(){ int num; do { scanf("%d", &num); printf("%d", num); } while(num != 42); return 0; }
Hey guys, I am particularly new to coding I tried with C while giving a solution to this problem but I'm always getting an SIGSEGV error Pleas Help!!Here is my code
#include <stdio.h> int main() { int a[20], x, count=0; do{ scanf("%d\n", &x); a[count]=x; count++; }while(x!=42); x=0; for(x; x<count-1; x++){ printf("%d\n", a[x]); } return 0; }
Read the forum, there are lots of questions asking this. And answers If I'm allowed to quote myself:
#include <stdio.h>
int main(void) { // your code here int a; while(a!=42) { scanf("%d",&a); if(a==42) break; printf("%d",a); }
return 0;
} Can u find problem in this code ?
is there any problem with this code.??it gives the output but still its showing error.
#include<stdio.h> int main() { int i,n,j; int ch[5]; scanf("%d",&n); for(j=0;j<n;j++) { scanf("%d",&ch[j]); } for(i=0;i<n;i++) { if(ch[i]<ch[i+1]) printf("\n%d",ch[i]); else break; } if(ch[i]>ch[i+1]) printf("\n%d",ch[i]); return 0; }
you’ve got to terminate the class.
I Have corrected your problem in my code.
here you go.
int main(void) { // your code here
int n; while(scanf("%d", &n)&&n<=99) { if (n==42) break; else printf("%d\n", n); } return 0;
}