If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.

Answer Posted / akhiltelaprolu

#include<stdio.h>
main()
{
int n,a[20],b[20],i,j;
for(i=0;i<n;i++)
scanf("%d",&a[i]);
i=0;
for(j=0;j<n/2;j++)
{
b[j]=a[i]+a[n-1];
i++;
n=n-1;
}
for(j=0;j<n/2;j++)
printf("%d",b[j]);
if(n%2!=0)
printf("%d",a[n/2]):
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me with an example the self-referential structure?

560


What does s c mean on snapchat?

579


What is data structure in c programming?

568


Why do we use pointer to pointer in c?

593


Why is c platform dependent?

616






Is multithreading possible in c?

562


What are the different file extensions involved when programming in C?

752


What does. int *x[](); means ?

631


Is c compiled or interpreted?

659


What are the __date__ and __time__ preprocessor commands?

566


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

802


What is a program flowchart and explain how does it help in writing a program?

668


What is an array? What the different types of arrays in c?

653


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

749


What are # preprocessor operator in c?

626