Welcome to AMIE Study - AMIE India Students Forum

AMIE Study - AMIE India Students Forum

collapse collapse

* Shoutbox

Refresh History
  • [email protected]: Can anyone tell if Saudi Engineers Council accept  AMiE or not?
    July 18, 2018, 11:38:24 AM
  • Khadeejath Shamna: Can we send section b registration form and examination form together?  When can we register for section b winter exam 2018?
    July 09, 2018, 03:46:15 PM
  • GCPATIL: How to change mobile number and email address
    July 09, 2018, 01:33:10 AM
  • Sanoj.kaushik: Hi everyone, It is informed that civil lab experiments at Manav Rachna Institute would be started in mid july. So, kindly informed to other friends.
    June 15, 2018, 05:33:15 PM
  • ramajit: yes. i also need help for project work. any format or ref available. pls send me email [email protected]
    June 12, 2018, 10:22:21 AM
  • JYOTI VERMA: mail me on [email protected]
    June 10, 2018, 09:33:12 PM
  • JYOTI VERMA: i wqnt to know about mechanical project work topiics.please send me it on my mail if any one have
    June 10, 2018, 09:32:34 PM
  • JYOTI VERMA: hi
    June 10, 2018, 09:31:45 PM
  • ravihgaali: Plz send me 2018 summer Section A question papers. My email is [email protected]
    June 07, 2018, 02:24:16 PM
  • ravihgaali: Plz send me 2018 summer Section A question papers
    June 07, 2018, 02:23:54 PM
  • abhijit deshmukh: hi , anyone have sectional B Electrical Engineer Optional Subeject question paper plez send me my Mail ID : [email protected]
    May 29, 2018, 03:51:55 PM
  • kathiravanlks: Mc 423 analysis and synthesis questions papers if y have share ....pls
    May 29, 2018, 11:19:54 AM
  • St6301790: hey can any one help me to download my admit card for section B. I am new in section B
    May 27, 2018, 06:15:42 PM
  • Vickytrips: Hii everyone....plz suggest book regarding design of electronics devices and circuit and electronics circuit
    May 16, 2018, 05:48:52 PM
  • vikas2eg: For AMIE Sec-A&B handwritten study material contact - [email protected] or [email protected] 8349801101
    May 02, 2018, 09:46:13 PM
  • mf1482: I need Mining Engineering MN 413 Old question papers. Can anybody Provide?  sunil  9414245175
    May 01, 2018, 09:35:03 PM
  • manirock87: HI RAAHUL.YG, FOR ANY STREAM, PROJECT AND LAB IS COMPULSORY FOR SECTION BIS
    April 28, 2018, 09:07:02 PM
  • manirock87: HI ANKI22 NO ONE ELSE CAN HELP. U NEED TO SEND MAIL TO [email protected] AND CALL AT 03340155400
    April 28, 2018, 09:05:47 PM
  • anki22: can any one  help.?. what is mean of login here ..if no one can help
    April 13, 2018, 11:48:34 PM
  • raahul.yg: Section B MECHANICAL project
    April 12, 2018, 02:11:42 PM

* Search


* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Board Stats

  • stats Total Members: 48649
  • stats Total Posts: 27327
  • stats Total Topics: 6603
  • stats Total Categories: 6
  • stats Total Boards: 31
  • stats Most Online: 626

Author Topic: C program old questionpaper source code  (Read 1655 times)

Description:
September 05, 2012, 01:33:50 AM
  • Registered User
  • *
  • Posts: 20
    • View Profile
Advertisement
/*
Write a C program that will accept an integer N as
input if and only if that integer N lies within 0-9999.
Then it will produce the summation of its digits and
lastly prints the integer as well as the summation.

*/

#include<stdio.h>?
#include<conio.h>
void main()
{
long int n,i,s=0;
clrscr();
printf("n enter ur number ;");
scanf("%ld",&n);
if((n>=0)&&(n<=9999))
{
for(i=0;i<=n;i++)
{
s=s+i;
}
printf("n the sum of %ld number is %ld",n,s);
}
else
{
printf("n sry ur number not lies within the limit");
}
getch();
}
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »


May 31, 2015, 05:45:08 AM
Reply #1
  • Registered User
  • *
  • Posts: 1
    • View Profile
Dear Friends,
The correct coding for calculate the numbers is;

#include<stdio.h>
#include<conio.h>
void main()
{
long int n,i,s=0;

printf("n enter ur number ;");
scanf("%ld",&n);
if((n>=0)&&(n<=9999))
{
while(n>0)
{
    s=s+n%10;
    n=n/10;
}

printf("n the sum of %ld number is %ld",n,s);
}
else
{
printf("n sry ur number not lies within the limit");
}
getch();
}
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
 

Related Topics

  Subject / Started by Replies Last post
26 Replies
14690 Views
Last post August 07, 2013, 10:16:10 AM
by prasadcaher
5 Replies
6864 Views
Last post August 03, 2011, 12:21:08 PM
by Ripan
1 Replies
526 Views
Last post August 24, 2009, 05:41:27 PM
by praveen
0 Replies
955 Views
Last post July 09, 2011, 07:32:40 PM
by Nihil
0 Replies
4046 Views
Last post August 03, 2011, 09:28:05 PM
by midhun
2 Replies
529 Views
Last post September 29, 2011, 02:28:23 PM
by skarmakar007
0 Replies
1132 Views
Last post September 05, 2012, 09:12:06 PM
by sainathan

* Search

* Subscribe to Forum

Enter your email address:

Advertisement

* Recent Posts

Re: making whatsapp group by Jayeshkarthick
[July 06, 2018, 01:25:46 PM]


Re: making whatsapp group by Bikash Chatterjee
[June 13, 2018, 06:38:48 PM]


Re: Free Download AMIE Winter 2016 Unsolved Question Papers for Section A&B by amitavacivil
[June 11, 2018, 03:54:22 PM]


amie mechanical project work by JYOTI VERMA
[June 10, 2018, 09:47:58 PM]


Re: making whatsapp group by chandan amie
[June 05, 2018, 04:33:00 AM]