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
Tell me with an example the self-referential structure?
What does s c mean on snapchat?
What is data structure in c programming?
Why do we use pointer to pointer in c?
Why is c platform dependent?
Is multithreading possible in c?
What are the different file extensions involved when programming in C?
What does. int *x[](); means ?
Is c compiled or interpreted?
What are the __date__ and __time__ preprocessor commands?
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 ?
What is a program flowchart and explain how does it help in writing a program?
What is an array? What the different types of arrays in c?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
What are # preprocessor operator in c?