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
What is static memory allocation? Explain
Why main is used in c?
write a program for the normal snake games find in most of the mobiles.
What Is The Difference Between Null And Void Pointer?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What are the main characteristics of c language describe the structure of ac program?
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
Tell me can the size of an array be declared at runtime?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Explain why C language is procedural?
What are the types of c language?
What is 2c dna?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
What is actual argument?