Ca some one please help me with aC code to allow user enter
numbers from 1 to 20 without repeating and prnt the sum of
those numbers
thnx
Answer Posted / asadhsheriff
int main()
{
int a[20],i,j,count=0;
memset(a,0,20);
for(;count<=20;)
{
scanf("%d",&j);
if(a[j]==0)
{
count++;
a[j]=j;
}
}
i=20(10)/2;
printf("The sum is %d",i);
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
Explain the difference between #include "..." And #include <...> In c?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
What are lookup tables in c?
What is this infamous null pointer, anyway?
What is c programming structure?
Explain the use of 'auto' keyword in c programming?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
What is the need of structure in c?
How to Throw some light on the splay trees?
Why do we use null pointer?
If you know then define #pragma?
what is the diffrenet bettwen HTTP and internet protocol
What does it mean when the linker says that _end is undefined?