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
How to write c functions that modify head pointer of a linked list?
explain how do you use macro?
PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
In C programming, what command or code can be used to determine if a number of odd or even?
What is the difference between text files and binary files?
what is the role you expect in software industry?
What is a macro in c preprocessor?
How #define works?
Differentiate call by value and call by reference?
What does malloc () calloc () realloc () free () do?
What are dangling pointers? How are dangling pointers different from memory leaks?
Write a program of advanced Fibonacci series.
What are local static variables?
What is meant by recursion?