AAQIB ANAYAT
-
write a c program to calculate average of array elements
#include <stdio.h>main() { int n, i, num[100]; float sum = 0.0, avg; printf("Enter the size array : n"); scanf("%d", &n);…
Read More » -
wirte a c program to perform basic operations on arrays
#include<stdio.h>#include<conio.h>void main() {int a[100],a2[100],n,i;printf("Enter No. of Elements you want to enter in Array : n");scanf("%d",&n);for(i=0;i<n;i++){printf("Enter %d Element ",i+1);scanf("%d",&a[i]);}printf("Elements in array…
Read More » -
write a c progarm to calculate post charges by weight of package
#include<stdio.h>main(){ int weight; printf("Enter the weightn"); scanf("%d",&weight); if(weight<=20) { printf("Charges are 5n"); } else if(weight<=100) { printf("Charges are 9.0n"); }…
Read More » -
write a c program to calculate call charges
#include<stdio.h>main(){ int noc; float res; printf("Enter the number of callsn"); scanf("%d",&noc); if(noc<=50) { printf("NILL ! no chargesn"); } else if(noc<=100)…
Read More » -
write a c program to convert a given number into binary and a binary number to decimal
#include <math.h>#include <stdio.h>int convert(long n);long convert_decimal_to_binary(int n);main(){ int dec; long n; printf("Enter a binary number: "); scanf("%lld", &n); printf("%lld in…
Read More » -
call by value and call by reference demonstration
#include <stdio.h> void swap_call_by_value(int , int ); void swap_call_by_refrence(int *, int *); //prototype of the function int main()…
Read More » -
write a c program to find the ascii value of a given charactere
#include <stdio.h>main() { char c; printf("Enter a character: "); scanf("%c", &c); printf("ASCII value of %c = %d", c, c); getch();}
Read More » -
write a c program to calculate percentage of marks obtained by a student
#include <stdio.h> int main() { int cLan, data_structures, operating_system, software_engineering, computer_organisation; float total, average, percentage; /* Input marks of all…
Read More » -
write a c program to print prime numberes upto a given value/number
#include<stdio.h>int main(){ int n,i,fact,j; printf("Enter the lemit upto you want to print prime numbersnn"); scanf("%d",&n); printf("nPrime Numbers are: n"); for(i=1;…
Read More » -
write a c program to print address and values of pointer
#include <stdio.h>main() { int a; int *pt; printf("Pointer Example Program : Print Pointer Addressn"); a = 10; pt = &a;…
Read More » -
write a c program to print pyramid pattern of given rows
#include<stdio.h>int main(){ int Rows, i, j, k = 0; printf("Please Enter the Number of Rows: "); scanf("%d", &Rows); printf("Your Pyramid…
Read More » -
write a c program to find area of a circle and circumfrence of a circle
#include<stdio.h>main() { int radius; float PI = 3.14, area, ci; printf("nEnter radius of circle: "); scanf("%d", &radius); area = PI…
Read More » -
write a c progam to reverse a given number using function
#include<stdio.h>#include<conio.h>//REVERSE NUMBER USING FUNCTIONvoid rev(int);void main(){int num;printf("enter any numbern");scanf("%d",&num);rev(num);getch();}void rev(int n){int rev=0,r;while(n!=0){r=n%10;rev=rev*10+r;n=n/10;}printf("reversed number=%d",rev);}
Read More » -
write a c program to reverse a given number
#include <stdio.h>int main() { int n, rev = 0, remainder; printf("Enter an integer: "); scanf("%d", &n); while (n != 0)…
Read More » -
write a c program to concetnate two inputed strings
#include <stdio.h>#include <string.h>main(){ char a[1000], b[1000]; printf("Enter the first stringn"); gets(a); printf("Enter the second stringn"); gets(b); strcat(a, b); printf("String obtained…
Read More »