0% found this document useful (0 votes)
36 views2 pages

C Programming Tutorial (II Sem B.Tech. - D Section)

This document provides a summary of programming tasks for a C programming tutorial, including: 1) Writing programs to perform operations on complex numbers using structures, find prime numbers between intervals, and check if a number can be expressed as a sum of two primes using functions. 2) A program to multiply two matrices. 3) What the output would be for code snippets testing logical operators, string manipulation, and recursion. 4) A program to sort an array of 20 unique elements from 1-100 using one loop. 5) A program to print a numeric pyramid pattern. 6) Programs to convert between binary and decimal numbers.

Uploaded by

Vishnu Kanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views2 pages

C Programming Tutorial (II Sem B.Tech. - D Section)

This document provides a summary of programming tasks for a C programming tutorial, including: 1) Writing programs to perform operations on complex numbers using structures, find prime numbers between intervals, and check if a number can be expressed as a sum of two primes using functions. 2) A program to multiply two matrices. 3) What the output would be for code snippets testing logical operators, string manipulation, and recursion. 4) A program to sort an array of 20 unique elements from 1-100 using one loop. 5) A program to print a numeric pyramid pattern. 6) Programs to convert between binary and decimal numbers.

Uploaded by

Vishnu Kanth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

C Programming Tutorial (II sem B.Tech.

– D section)
1. Write a C program to do the following:
a. To add and subtract to complex numbers using structures.
b. Display Prime Numbers Between Two Intervals.
c. Check Whether a Number can be Expressed as Sum of Two Prime Numbers using
functions.
2. Program to multiply two matrices
3. What would be the output of the following?
(a)
#include <stdio.h>
int main()
{
int a[3][5]={{1,2,3,4,5},{6,7,8,9,10},{11,12,13,14,15}};
printf("%d %d",a[2][2],a[1][7]);
return 0;
}
(b)
#include<stdio.h>
int main()
{
char p[]="abcd2011";
printf("%s",p+p[3]-p[1]);
return 0;
}
(c)
#include<stdio.h>
int f(int *a,int n)
{
if(n<=0)
return 0;
else if (*a%2==0)
return *a+f(a+1,n-1);
else
return *a-f(a+1,n-1);
}
int main()
{
int a[]={12,7,13,4,11,6};
printf("%d",f(a,6));
return 0;
}
(d)
#include <stdio.h>
int main()
{
int a = 1, b = 2, c = 3;
c = a == b;
printf("%d", c);
return 0;
}
4.Write a C Program to sort an array of 20 elements(elments are from 1 to 100 without
repetition) using only one loop.
5.Write a C program to print the following pattern
1
232
34543
4567654
6.Write a C Program to Convert Binary Number to Decimal and vice-versa

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy