EXP5 - // or d=x%10 // s=a+b+c+d; avg=s/4;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<stdio.h> main() { int x,a,b,c,d,s,r; float avg; printf("Enter the 4 digit no"); scanf("%d",&x); a=x/1000; b=(x-(a*1000))/100; c=(x-(a*1000)-(b*100))/10; d=x-(a*1000)-(b*100)-(c*10);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // or d=x%10 // s=a+b+c+d; avg=s/4; r=(d*1000)+(c*100)+(b*10)+a; printf(&quot;\nThe sum,avg,reverse is%d%d%d&quot;,s,avg,r); return 0; }...
View Full Document

This note was uploaded on 10/25/2010 for the course CMPN SEM1 taught by Professor Thakur during the Spring '06 term at University of Mumbai.

Ask a homework question - tutors are online