S

@Shobh89

Write a program to check the repeating elements in C.

C
1 year ago
//C program for //checking duplicate //values in a array #include <stdio.h> int Sort(int arr[],int size) { for(int i=0;i<size-1;i++){ for(int j=0;j<size-i-1;j++){

Write a program to reverse an Array.

C
1 year ago
#include <stdio.h> int main() { int a[5],i; printf("Enter array Elements: "); for(i=0;i<=4;i++) { scanf("%d",&a[i]); } printf("\nReverse array Elements : ");

Write a Program to return the nth row of Pascal’s triangle.

C
1 year ago
//C program to return the Nth row of pascal's triangle #include <stdio.h> //Print the nth row of pascal's triangle void generateNthrow(int N) { //nc0=1 int prev=1; printf("%d",prev);

Write a program to form Pascal Triangle using numbers.

C
1 year ago
//C program to print //Pascal's triangle #include <stdio.h> int main() { int n=5; for(int i=1;i<=n;i++) {

Write a Program to create a pyramid pattern using C.

C
1 year ago
// C Program print Pyramid Pattern #include <stdio.h> int main() { int N=5; // Outer loop for number of rows for(int i=1;i<=N;i++){ // inner loop for space printing

Write a Program to find the area of a circle.

C
1 year ago
//C program to find area //of circle #include <stdio.h> #include<math.h> #define PI 3.142 double findArea(int r){return PI * pow (r,2);} int main() {

Write a Program in C to Print all natural numbers up to N without using a semi-colon.

C
1 year ago
//C program to print //all natural numbers //upto N using semi colon #include <stdio.h> #define N 10 int main(int val) { if(val<=N & printf("%d",val) && main(val+1)){

Write a C Program to find the Maximum and minimum of two numbers without using any loop or condition

C
1 year ago
//C program to check //Maximum and Minimum //Between two numbers // without any condition or loop #include <stdio.h> #include<stdlib.h> int main()

Write a C program to find the LCM of two numbers.

C
1 year ago
#include<stdio.h> int main(){ int n1,n2,max; printf("Enter two numbers: "); scanf("%d%d",&n1,&n2); //maximum number between n1 and n2 is stored in max

Write a C program to find the GCD of two numbers

C
1 year ago
#include <stdio.h> int main() { int n1,n2,i,gcd; printf("Enter two integers: "); scanf("%d %d",&n1,&n2); for(i=1;i<=n1&&i<=n2;++i)

Write a C Program to check if two numbers are equal without using the bitwise operator.

C
1 year ago
//C program for checking numbers //are equal using bitwise operator #include <stdio.h> int main() { int x=6; int y=2; //Using XOR

Check whether a number is a palindrome.

C
1 year ago
#include <stdio.h> int main() { // input 121<-->121 int n,c,s=0,r; printf("Enter any Number: "); scanf("%d",&n); c=n; while (n>0) {

Write a Program to reverse a number.

C
1 year ago
#include <stdio.h> int main() { //input 234-->432 int n,r; printf("Enter a number: "); scanf("%d",&n); while(n>0) {

Write a program to Find all the roots of a quadratic equation in C.

C
1 year ago
#include <stdio.h> #include<math.h> int main() { float a,b,c,d,r1,r2; printf("enter the value of a,b,c\n"); scanf("%f %f %f",&a,&b,&c); d=b*b-4*a*c; if(d==0)

Write a Program to Check if a number is an Armstrong number or not.

C
1 year ago
// C program to check given number is // Armstrong number or not using Sum // of Digits #include <stdio.h> // Driver code int main() { int n,r,sum=0,temp; printf("enter the number=");

Write a program to Factorial of a Number.

C
1 year ago
#include <stdio.h> int main() { int num,count,fact=1; printf("Enter a number to find its factorial\n"); scanf("%d",&num); for(count=1;count<=num;count++) {

Write a Program to check if the year is a leap year or not.

C
1 year ago
#include <stdio.h> int main() { int y; printf("Enter any year : "); scanf("%d",&y); if(y%400==0 || y%4==0 && y%100!=0) { printf("Year is leapyear");

Write a Program to convert the binary number into a decimal number.

C
1 year ago
//C Program for Converting //Binary to Decimal #include <stdio.h> int main() { int N=11011100; //Initializing base value a to 1 int a =1;

Write a Program to Replace all 0’s with 1’s in a Number.

C
1 year ago
//C program for //Replacing 0 and 1 #include <stdio.h> #include<math.h> int main() { int N=102301; int ans=0;

Write a Program in C to Swap the values of two variables without using any extra variable.

C
1 year ago
//C program //Swap two numbers //NO Extra Space #include <stdio.h> int main() { int x=90; int y=89; printf("x : %d , y: %d\n",x,y); //Code to swap two numbers