Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

#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); }

1123


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

1206


Explain the difference between #include "..." And #include <...> In c?

1029


How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?

1113


What are lookup tables in c?

1001


What is this infamous null pointer, anyway?

1055


What is c programming structure?

1201


Explain the use of 'auto' keyword in c programming?

1121


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2449


What is the need of structure in c?

1124


How to Throw some light on the splay trees?

1064


Why do we use null pointer?

1065


If you know then define #pragma?

1104


what is the diffrenet bettwen HTTP and internet protocol

1840


What does it mean when the linker says that _end is undefined?

1098