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); }
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
What is unsigned int in c?
Explain the use of 'auto' keyword in c programming?
What is I ++ in c programming?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
Do you know null pointer?
Is there anything like an ifdef for typedefs?
How does normalization of huge pointer works?
What is the difference between single charater constant and string constant?
Tell me is null always defined as 0(zero)?
What language is lisp written in?
Apart from dennis ritchie who the other person who contributed in design of c language.
What is the use of extern in c?
What are reserved words with a programming language?